From f7973925fdae1f51fec16c263e1cc53f98c698e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sarah=20H=C3=BClsen?= <49907095+sarah-hlsn@users.noreply.github.com> Date: Fri, 20 Oct 2023 14:51:44 +0200 Subject: [PATCH] Change event_name default to event_id Changed default value for event_name in Hazard.from_xarray_raster to list of strings of event id. Also changed variable description in .from_xarray_raster class method. --- climada/hazard/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/climada/hazard/base.py b/climada/hazard/base.py index 30cfeb0c08..a79aad923f 100644 --- a/climada/hazard/base.py +++ b/climada/hazard/base.py @@ -518,7 +518,7 @@ def from_xarray_raster( :py:meth:`Hazard.__init__` for details. * ``hazard_type``: Empty string * ``frequency``: 1.0 for every event - * ``event_name``: String representation of the event time + * ``event_name``: String representation of the event id * ``event_id``: Consecutive integers starting at 1 and increasing with time crs : str, optional Identifier for the coordinate reference system of the coordinates. Defaults @@ -840,7 +840,7 @@ def maybe_repeat(values: np.ndarray, times: int) -> np.ndarray: None, np.ones(num_events), np.array(range(num_events), dtype=int) + 1, - list(data[coords["event"]].values), + [str(x) for x in np.array(range(num_events), dtype=int) + 1], np.array(u_dt.datetime64_to_ordinal(data[coords["event"]].values)), ], # The accessor for the data in the Dataset