Skip to content

Commit 16792b8

Browse files
emanuel-schmidNicolas Colombi
andauthored
eccodes dependency update (#947)
* eccodes changed variable names: i.p., gust -> i10fg * requirements: apparently the need for fiona has ended with eccodes>=2.28 * pin geopandas down to 0.x for the time being * dependencies: as long as geopandas is <1, fiona is automatically installed * black the branch * storm_europe: accept gust and alternatively i10fg * find the appropriate data variable name * dependencies: add/remove comments * dependencies: pinning cfgrib is apparently not required anymore --------- Co-authored-by: Nicolas Colombi <[email protected]>
1 parent 9cfa8ad commit 16792b8

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

climada/hazard/storm_europe.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,15 @@ def from_icon_grib(
551551
+ run_datetime.strftime("%Y%m%d%H")
552552
)
553553

554+
# Starting with eccodes 2.28 the name of the data variable in `stacked` is
555+
# [i10fg](https://codes.ecmwf.int/grib/param-db/228029).
556+
# Before, it used to be the less precise
557+
# [gust](https://codes.ecmwf.int/grib/param-db/260065)
558+
[data_variable] = list(stacked)
559+
554560
# Create Hazard
555561
haz = cls(
556-
intensity=sparse.csr_matrix(stacked["gust"].T),
562+
intensity=sparse.csr_matrix(stacked[data_variable].T),
557563
centroids=cls._centroids_from_nc(nc_centroids_file),
558564
event_id=event_id,
559565
date=date,
@@ -1069,7 +1075,7 @@ def generate_WS_forecast_hazard(
10691075
if haz_model == "cosmo1e_file":
10701076
haz_model = "C1E"
10711077
full_model_name_temp = "COSMO-1E"
1072-
if haz_model == "cosmo2e_file":
1078+
else: # if haz_model == "cosmo2e_file":
10731079
haz_model = "C2E"
10741080
full_model_name_temp = "COSMO-2E"
10751081
haz_file_name = (

requirements/env_climada.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ channels:
55
dependencies:
66
- bottleneck>=1.4
77
- cartopy>=0.23
8-
- cfgrib>=0.9.9,<0.9.10 # 0.9.10 cannot read the icon_grib files from https://opendata.dwd.de
8+
- cfgrib>=0.9.9
99
- contextily>=1.6
1010
- dask>=2024.5
11-
- eccodes>=2.27,<2.28 # 2.28 changed some labels, in particular: gust -> i20fg
11+
- eccodes>=2.27
1212
- gdal>=3.6
13-
- geopandas>=0.14
13+
- geopandas>=0.14,<1.0 # geopandas 1.0 does not depend on fiona anymore, hence fiona would need to be added as dependency
1414
- h5py>=3.8
1515
- haversine>=2.8
1616
- matplotlib-base>=3.9

0 commit comments

Comments
 (0)