diff --git a/README.md b/README.md index 5dfef4b..5dd0a66 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ from meteole import AromeForecast arome_client = AromeForecast(application_id=APPLICATION_ID) # Check indicators available -print(arome_client.indicators) +print(arome_client.INDICATORS) # Fetch weather data df_arome = arome_client.get_coverage( diff --git a/docs/pages/how_to.md b/docs/pages/how_to.md index 338a220..2e0df74 100644 --- a/docs/pages/how_to.md +++ b/docs/pages/how_to.md @@ -61,7 +61,7 @@ from meteole import AromeForecast arome_client = AromeForecast(application_id=APPLICATION_ID) # APPLICATION_ID found on portail.meteo-france.Fr # Check indicators available -print(arome_client.indicators) +print(arome_client.INDICATORS) # Fetch weather data df_arome = arome_client.get_coverage( diff --git a/src/meteole/forecast.py b/src/meteole/forecast.py index 62bec8d..0ed0cec 100644 --- a/src/meteole/forecast.py +++ b/src/meteole/forecast.py @@ -7,7 +7,6 @@ from abc import ABC, abstractmethod from functools import reduce from typing import Any -from warnings import warn import pandas as pd import xarray as xr @@ -91,25 +90,6 @@ def capabilities(self) -> pd.DataFrame: self._capabilities = self._build_capabilities() return self._capabilities - @property - def indicators(self) -> list[str]: - """Getter method of the indicators. - - Indicators are identifying the kind of a predicted value (i.e., measurement). - - Warning: This method is deprecated as INDICATORS is now a class constant. - - Returns: - List of covered indicators. - """ - warn( - "The 'indicators' attribute is deprecated, it will be removed soon. " - "Use 'INDICATORS' instead (class constant).", - DeprecationWarning, - stacklevel=2, - ) - return self.INDICATORS - @abstractmethod def _validate_parameters(self) -> None: """Check the territory and the precision parameters. @@ -282,7 +262,7 @@ def _get_coverage_id( capabilities = self.capabilities[self.capabilities["indicator"] == indicator] if indicator not in self.INDICATORS: - raise ValueError(f"Unknown `indicator` - checkout `{self.MODEL_NAME}.indicators` to have the full list.") + raise ValueError(f"Unknown `indicator` - checkout `{self.MODEL_NAME}.INDICATORS` to have the full list.") if run is None: run = capabilities.iloc[0]["run"] diff --git a/tutorial/Fetch_forecast_for_multiple_indicators.ipynb b/tutorial/Fetch_forecast_for_multiple_indicators.ipynb index 221bf1e..8f17ace 100644 --- a/tutorial/Fetch_forecast_for_multiple_indicators.ipynb +++ b/tutorial/Fetch_forecast_for_multiple_indicators.ipynb @@ -69,7 +69,7 @@ "outputs": [], "source": [ "# Select random indicators to get\n", - "random_indicators = random.sample(client.indicators, 5)\n", + "random_indicators = random.sample(client.INDICATORS, 5)\n", "print(f\"Selected Indicators: {random_indicators}\")" ] }, diff --git a/tutorial/Fetch_forecasts.ipynb b/tutorial/Fetch_forecasts.ipynb index 8d93d3a..c093949 100644 --- a/tutorial/Fetch_forecasts.ipynb +++ b/tutorial/Fetch_forecasts.ipynb @@ -69,7 +69,7 @@ "outputs": [], "source": [ "# pick a random indicator\n", - "random_indicator = random.choice(arome.indicators)\n", + "random_indicator = random.choice(arome.INDICATORS)\n", "print(f\"Indicator: {random_indicator}\")" ] }, @@ -79,7 +79,7 @@ "metadata": {}, "outputs": [], "source": [ - "arome.indicators" + "arome.INDICATORS" ] }, { @@ -145,9 +145,9 @@ ], "metadata": { "kernelspec": { - "display_name": "inondation", + "display_name": "meteole_env", "language": "python", - "name": "inondation" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -159,7 +159,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.14" + "version": "undefined.undefined.undefined" }, "toc": { "base_numbering": 1,