Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/how_to.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
22 changes: 1 addition & 21 deletions src/meteole/forecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion tutorial/Fetch_forecast_for_multiple_indicators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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}\")"
]
},
Expand Down
10 changes: 5 additions & 5 deletions tutorial/Fetch_forecasts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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}\")"
]
},
Expand All @@ -79,7 +79,7 @@
"metadata": {},
"outputs": [],
"source": [
"arome.indicators"
"arome.INDICATORS"
]
},
{
Expand Down Expand Up @@ -145,9 +145,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "inondation",
"display_name": "meteole_env",
"language": "python",
"name": "inondation"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -159,7 +159,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
"version": "undefined.undefined.undefined"
},
"toc": {
"base_numbering": 1,
Expand Down
Loading