Skip to content

Commit 8139460

Browse files
Merge branch 'develop' into feature/from_netcdf_fast
2 parents 50c7218 + 316f33b commit 8139460

File tree

4 files changed

+262
-277
lines changed

4 files changed

+262
-277
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 = (

climada/util/calibrate/test/test_bayesian_optimizer.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,9 @@ def test_optimizer_params(self):
9494
)
9595
result = contr.optimizer_params()
9696

97-
self.assertDictContainsSubset(
98-
{
99-
"init_points": 1,
100-
"n_iter": 2,
101-
},
102-
result,
103-
)
97+
self.assertEqual(result.get("init_points"), 1)
98+
self.assertEqual(result.get("n_iter"), 2)
99+
104100
util_func = result["acquisition_function"]
105101
self.assertEqual(util_func.kappa, 3)
106102
self.assertEqual(util_func._kappa_decay, contr._calc_kappa_decay())

0 commit comments

Comments
 (0)