You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our company uses Open-Meteo's Forecast API for the simulation of scenarios.
We allow users to select a weather model for wind simulations. We default to best_match if no weather model is provided or if the requested weather model is unavailable for the location. In this case, we would like to inform the user which weather model was selected.
Currently, when best_match is requested as a weather model, open-meteo's response returns best_match, and no information on which weather model was actually selected. We kindly ask for this information to be returned.
Here is some code to reproduce:
importopenmeteo_requestsimportrequests_cacheimportpandasaspdfromretry_requestsimportretryfromopenmeteo_sdkimportModel# Returns model as stringdef_model_to_string(model):
""" Convert the weather model to a string. Args: model: Weather model. Returns: str: Weather model as a string. """forname, valueinModel.Model.__dict__.items():
ifvalue==model:
returnnamereturnNone# Setup the Open-Meteo API client with cache and retry on errorcache_session=requests_cache.CachedSession('.cache', expire_after=3600)
retry_session=retry(cache_session, retries=5, backoff_factor=0.2)
openmeteo=openmeteo_requests.Client(session=retry_session)
# Make sure all required weather variables are listed here# The order of variables in hourly or daily is important to assign them correctly belowurl="https://api.open-meteo.com/v1/forecast"params= {
"latitude": 52.52,
"longitude": 13.41,
"hourly": "temperature_2m",
# Non-valid wm for location: ["arpae_cosmo_2i"]. Valid wm for location: arpae_cosmo_5m"models": ["arpae_cosmo_2i","arpae_cosmo_5m","best_match"]
}
responses=openmeteo.weather_api(url, params=params)
accepted_wms_names= []
accepted_wms_enums= []
forresponseinresponses:
accepted_wms_names.append(_model_to_string(response.Model()))
accepted_wms_enums.append(response.Model())
print(accepted_wms_names)
print(accepted_wms_enums)
Returns:
['arpae_cosmo_5m', 'best_match']
[59, 1]
We wish that it returned (assuming that ecmwf_ifs04 was selected by open-meteo as the best weather model for the location):
['arpae_cosmo_5m', 'ecmwf_ifs04']
[59, 2]
The text was updated successfully, but these errors were encountered:
Hi, thanks for the suggestion. best_match is a bit more complicated than just selecting a single weather model. Depending on the weather variable, different models might be used. Getting all meta data right will challenging. See #mete
Our company uses Open-Meteo's Forecast API for the simulation of scenarios.
We allow users to select a weather model for wind simulations. We default to
best_match
if no weather model is provided or if the requested weather model is unavailable for the location. In this case, we would like to inform the user which weather model was selected.Currently, when
best_match
is requested as a weather model, open-meteo's response returnsbest_match
, and no information on which weather model was actually selected. We kindly ask for this information to be returned.Here is some code to reproduce:
Returns:
We wish that it returned (assuming that
ecmwf_ifs04
was selected by open-meteo as the best weather model for the location):The text was updated successfully, but these errors were encountered: