1- """The interface for the observational data from the meteo-France API.
2-
3- See :
4- - https://portail-api.meteofrance.fr/web/fr/api/arpege
5- """
6-
71from __future__ import annotations
82
93from typing import Any , final
104
115from meteole .clients import BaseClient , MeteoFranceClient
12- from meteole .forecast import Forecast
6+ from meteole .forecast import WeatherForecast
137
148AVAILABLE_ARPEGE_TERRITORY : list [str ] = ["EUROPE" , "GLOBE" , "ATOURX" , "EURAT" ]
159
6862
6963
7064@final
71- class ArpegeForecast (Forecast ):
72- """Access the ARPEGE numerical forecast data."""
65+ class ArpegeForecast (WeatherForecast ):
66+ """Access the ARPEGE numerical weather forecast data from Meteo-France API.
67+
68+ Doc:
69+ - https://portail-api.meteofrance.fr/web/fr/api/arpege
70+
71+ Attributes:
72+ territory: Covered area (e.g., FRANCE, ANTIL, ...).
73+ precision: Precision value of the forecast.
74+ capabilities: DataFrame containing details on all available coverage ids.
75+ """
7376
7477 # Model constants
7578 MODEL_NAME : str = "arpege"
@@ -87,24 +90,20 @@ def __init__(
8790 territory : str = "EUROPE" ,
8891 ** kwargs : Any ,
8992 ):
90- """
91- Initializes an ArpegeForecast object for accessing ARPEGE forecast data.
93+ """Initializes an ArpegeForecast object.
9294
9395 The `precision` of the forecast is inferred from the specified `territory`.
9496
9597 Args:
96- territory (str, optional): The ARPEGE territory to fetch. Defaults to "EUROPE".
97- api_key (str | None, optional): The API key for authentication. Defaults to None.
98- token (str | None, optional): The API token for authentication. Defaults to None.
99- application_id (str | None, optional): The Application ID for authentication. Defaults to None.
100- cache_dir (str | None, optional): Path to the cache directory. Defaults to None.
101- If not provided, the cache directory is set to "/tmp/cache".
98+ territory: The ARPEGE territory to fetch. Defaults to "EUROPE".
99+ api_key: The API key for authentication. Defaults to None.
100+ token: The API token for authentication. Defaults to None.
101+ application_id: The Application ID for authentication. Defaults to None.
102102
103103 Notes:
104104 - See `MeteoFranceClient` for additional details on the parameters `api_key`, `token`,
105105 and `application_id`.
106106 - Available territories are listed in the `AVAILABLE_TERRITORY` constant.
107-
108107 """
109108 super ().__init__ (
110109 client = client ,
@@ -113,7 +112,11 @@ def __init__(
113112 ** kwargs ,
114113 )
115114
116- def _validate_parameters (self ):
117- """Assert the parameters are valid."""
115+ def _validate_parameters (self ) -> None :
116+ """Check the territory and the precision parameters.
117+
118+ Raise:
119+ ValueError: At least, one parameter is not good.
120+ """
118121 if self .territory not in AVAILABLE_ARPEGE_TERRITORY :
119122 raise ValueError (f"The parameter precision must be in { AVAILABLE_ARPEGE_TERRITORY } " )
0 commit comments