Skip to content

Commit

Permalink
Merge branch 'develop' into feature/from_netcdf_fast
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasColombi committed Feb 12, 2025
2 parents 50c7218 + 316f33b commit 8139460
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 277 deletions.
10 changes: 8 additions & 2 deletions climada/hazard/storm_europe.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,15 @@ def from_icon_grib(
+ run_datetime.strftime("%Y%m%d%H")
)

# Starting with eccodes 2.28 the name of the data variable in `stacked` is
# [i10fg](https://codes.ecmwf.int/grib/param-db/228029).
# Before, it used to be the less precise
# [gust](https://codes.ecmwf.int/grib/param-db/260065)
[data_variable] = list(stacked)

# Create Hazard
haz = cls(
intensity=sparse.csr_matrix(stacked["gust"].T),
intensity=sparse.csr_matrix(stacked[data_variable].T),
centroids=cls._centroids_from_nc(nc_centroids_file),
event_id=event_id,
date=date,
Expand Down Expand Up @@ -1069,7 +1075,7 @@ def generate_WS_forecast_hazard(
if haz_model == "cosmo1e_file":
haz_model = "C1E"
full_model_name_temp = "COSMO-1E"
if haz_model == "cosmo2e_file":
else: # if haz_model == "cosmo2e_file":
haz_model = "C2E"
full_model_name_temp = "COSMO-2E"
haz_file_name = (
Expand Down
10 changes: 3 additions & 7 deletions climada/util/calibrate/test/test_bayesian_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,9 @@ def test_optimizer_params(self):
)
result = contr.optimizer_params()

self.assertDictContainsSubset(
{
"init_points": 1,
"n_iter": 2,
},
result,
)
self.assertEqual(result.get("init_points"), 1)
self.assertEqual(result.get("n_iter"), 2)

util_func = result["acquisition_function"]
self.assertEqual(util_func.kappa, 3)
self.assertEqual(util_func._kappa_decay, contr._calc_kappa_decay())
Expand Down
Loading

0 comments on commit 8139460

Please sign in to comment.