-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow reading Hazard events that are not dates from xarray (#837)
* Allow reading Hazard events that are not dates from xarray * Set default value of `Hazard.event_name` to empty string. * Try interpreting values of the event coordinate as dates or ordinals for default values of `Hazard.date`. If that fails, issue a warning and set default values to zeros. * Update tests. * Try to read event coordinate as date * Update climada/hazard/base.py * Apply formatter to test_base_xarray.py * Set default ordinal to 1, fix tests * Fix linter warnings * Switch back to class setup for xarray tests * Clarify docstring of Hazard.from_xarray_raster * Update CHANGELOG.md * Update climada/hazard/base.py --------- Co-authored-by: Chahan M. Kropf <chahan.kropf@usys.ethz.ch>
- Loading branch information
Showing
3 changed files
with
90 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters