66import tempfile
77from abc import abstractmethod
88from pathlib import Path
9- from typing import Dict , List , Optional
109
1110import pandas as pd
1211import xarray as xr
@@ -59,7 +58,7 @@ def __init__(
5958 self .precision = precision
6059 self ._validate_parameters ()
6160
62- self .folderpath : Optional [ Path ] = None
61+ self .folderpath : Path | None = None
6362 self .get_capabilities ()
6463
6564 def get_capabilities (self ) -> pd .DataFrame :
@@ -111,7 +110,7 @@ def _get_available_feature(grid_axis, feature_name):
111110 features = [int (feature ) for feature in features ]
112111 return features
113112
114- def get_coverage_description (self , coverage_id : str ) -> Dict :
113+ def get_coverage_description (self , coverage_id : str ) -> dict :
115114 """This endpoint returns the available axis (times, heights) to properly query coverage
116115
117116 TODO: other informations can be fetched from this endpoint, not yet implemented.
@@ -136,7 +135,7 @@ def get_coverage_description(self, coverage_id: str) -> Dict:
136135
137136 def get_coverages (
138137 self ,
139- coverage_ids : List [str ],
138+ coverage_ids : list [str ],
140139 lat : tuple = const .FRANCE_METRO_LATITUDES ,
141140 long : tuple = const .FRANCE_METRO_LONGITUDES ,
142141 ) -> pd .DataFrame :
@@ -159,8 +158,8 @@ def get_coverages(
159158 def _get_coverage_id (
160159 self ,
161160 indicator : str ,
162- run : Optional [ str ] = None ,
163- interval : Optional [ str ] = None ,
161+ run : str | None = None ,
162+ interval : str | None = None ,
164163 ) -> str :
165164 """
166165 Get a coverage_id from `capabilities`.
@@ -234,9 +233,9 @@ def get_coverage(
234233 indicator : str | None = None ,
235234 lat : tuple = const .FRANCE_METRO_LATITUDES ,
236235 long : tuple = const .FRANCE_METRO_LONGITUDES ,
237- heights : List [int ] | None = None ,
238- pressures : List [int ] | None = None ,
239- forecast_horizons : List [int ] | None = None ,
236+ heights : list [int ] | None = None ,
237+ pressures : list [int ] | None = None ,
238+ forecast_horizons : list [int ] | None = None ,
240239 run : str | None = None ,
241240 interval : str | None = None ,
242241 coverage_id : str = "" ,
@@ -288,8 +287,8 @@ def get_coverage(
288287 return pd .concat (df_list , axis = 0 ).reset_index (drop = True )
289288
290289 def _raise_if_invalid_or_fetch_default (
291- self , param_name : str , inputs : List [int ] | None , availables : List [int ]
292- ) -> List [int ]:
290+ self , param_name : str , inputs : list [int ] | None , availables : list [int ]
291+ ) -> list [int ]:
293292 """
294293 Checks if the elements in `inputs` are in `availables` and raises a ValueError if not.
295294 If `inputs` is empty or None, uses the first element from `availables` as the default value.
@@ -345,7 +344,7 @@ def instant_indicators(self) -> str:
345344 """The list of instant indicators"""
346345 pass
347346
348- def _get_capabilities (self ) -> Dict :
347+ def _get_capabilities (self ) -> dict :
349348 """The Capabilities of the AROME/ARPEGE service."""
350349
351350 url = f"{ self .base_url } /{ self .entry_point } /GetCapabilities"
0 commit comments