Skip to content

Commit

Permalink
Update Hazard base.py
Browse files Browse the repository at this point in the history
Change event_name default for Hazard.from_xarray_raster to string of event id.
Change variable description in class method.
  • Loading branch information
sarah-hlsn committed Oct 20, 2023
1 parent 12c3190 commit b54a62f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions climada/hazard/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b54a62f

Please sign in to comment.