-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Hazard classmethod for loading xarray Datasets #507
Add Hazard classmethod for loading xarray Datasets #507
Commits on Jul 5, 2022
-
Add Hazard classmethod for loading NetCDF file
* Add classmethod `from_raster_netcdf` that loads a dataset from a NetCDF file and reads the appropriate data into a Hazard instance. * Add a new test file for testing this method. This is still WIP.
Configuration menu - View commit details
-
Copy full SHA for 4a9a520 - Browse repository at this point
Copy the full SHA 4a9a520View commit details
Commits on Jul 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 755f11e - Browse repository at this point
Copy the full SHA 755f11eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 525394b - Browse repository at this point
Copy the full SHA 525394bView commit details -
Read Hazard from datasets with varying dim/coord definitions
Make `Hazard.from_raster_netcdf` handle cases where coordinates with other names than dimensions are supposed to be read, and where coordinates are not flattened. The first is achieved by adding another method parameter so that users may specify *dimensions* and *coordinates* separately. The second is achieved by stacking the entire dataset, which also applies to possibly multi-dimensional coordinates, instead of flattening only the respective array. Add a new test case to cover the new capabilities.
Configuration menu - View commit details
-
Copy full SHA for 17564d5 - Browse repository at this point
Copy the full SHA 17564d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for cbc1dc5 - Browse repository at this point
Copy the full SHA cbc1dc5View commit details -
Configuration menu - View commit details
-
Copy full SHA for d90ca87 - Browse repository at this point
Copy the full SHA d90ca87View commit details
Commits on Jul 7, 2022
-
Extract dimension names from coordinates
This avoids relying on user input which dimensions to use.
Configuration menu - View commit details
-
Copy full SHA for 939968b - Browse repository at this point
Copy the full SHA 939968bView commit details -
Use lazy formatting for logger messages
This fixes some linter complaints.
Configuration menu - View commit details
-
Copy full SHA for b110a94 - Browse repository at this point
Copy the full SHA b110a94View commit details
Commits on Jul 11, 2022
-
Merge branch 'develop' into 487-add-classmethod-to-hazard-for-reading…
…-raster-like-data-from-netcdf-file
Configuration menu - View commit details
-
Copy full SHA for 4283cf6 - Browse repository at this point
Copy the full SHA 4283cf6View commit details
Commits on Jul 15, 2022
-
Reorganize test_base_netcdf.py
Move more complicated test case down
Configuration menu - View commit details
-
Copy full SHA for ab40d1a - Browse repository at this point
Copy the full SHA ab40d1aView commit details -
Consolidate tests for Hazard.intensity
np.testing.assert_array_equal already checks for matching array shapes.
Configuration menu - View commit details
-
Copy full SHA for 2a4283d - Browse repository at this point
Copy the full SHA 2a4283dView commit details -
Configuration menu - View commit details
-
Copy full SHA for dac5dd5 - Browse repository at this point
Copy the full SHA dac5dd5View commit details
Commits on Jul 27, 2022
-
Make
from_raster_xarray
read all Hazard dataAdd capability of reading all "optional" Hazard data through the `data_vars` parameter. "Optional" means that default values can be provided and hence the data is not strictly necessary. Changes: * Add possibility to read `date`, `event_id`, `event_name`, and `frequency` from data. * Add possibility to supply `haz_type` and `unit` through method parameters. * Provide defaults for all optionals. * Update docstrings. * Update tests.
Configuration menu - View commit details
-
Copy full SHA for 026a33f - Browse repository at this point
Copy the full SHA 026a33fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 528b99e - Browse repository at this point
Copy the full SHA 528b99eView commit details -
Remove 'fraction' parameter from 'from_raster_xarray'
* Make 'fraction' an optional argument and move it into `data_vars`. * Update tests.
Configuration menu - View commit details
-
Copy full SHA for d96a278 - Browse repository at this point
Copy the full SHA d96a278View commit details -
Configuration menu - View commit details
-
Copy full SHA for f817bca - Browse repository at this point
Copy the full SHA f817bcaView commit details -
Configuration menu - View commit details
-
Copy full SHA for fb94fc6 - Browse repository at this point
Copy the full SHA fb94fc6View commit details
Commits on Jul 28, 2022
-
Apply suggestions from code review
Use pathlib for more elegant file handling in tests Co-authored-by: Chahan M. Kropf <chahan.kropf@usys.ethz.ch>
Configuration menu - View commit details
-
Copy full SHA for bda69a6 - Browse repository at this point
Copy the full SHA bda69a6View commit details -
Improve docstrings and simplify
from_raster_xarray
* Improve docstrings of "internal" functions. * Rename `read_or default` to `load_data_or_default` and use argument list instead of `pd.Series` as single argument. * Avoid single letter variables. * Avoid unnecessary local variables. * Add more type hints.
Configuration menu - View commit details
-
Copy full SHA for 9c68a9e - Browse repository at this point
Copy the full SHA 9c68a9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 87033ea - Browse repository at this point
Copy the full SHA 87033eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for abc9d32 - Browse repository at this point
Copy the full SHA abc9d32View commit details
Commits on Jul 29, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 29b74f3 - Browse repository at this point
Copy the full SHA 29b74f3View commit details -
Preprocess dict arguments to save indentation level
This hopefully decreases code complexity slightly.
Configuration menu - View commit details
-
Copy full SHA for 7678d1f - Browse repository at this point
Copy the full SHA 7678d1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0fb24b - Browse repository at this point
Copy the full SHA c0fb24bView commit details
Commits on Aug 3, 2022
-
Configuration menu - View commit details
-
Copy full SHA for b8c46a3 - Browse repository at this point
Copy the full SHA b8c46a3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a9ea42 - Browse repository at this point
Copy the full SHA 7a9ea42View commit details
Commits on Aug 4, 2022
-
Configuration menu - View commit details
-
Copy full SHA for b2eea56 - Browse repository at this point
Copy the full SHA b2eea56View commit details
Commits on Aug 5, 2022
-
Update
Hazard.from_raster_xarray
(Hopefully) improve the readability of the method and its signature. * Move default coordinate keys and attribute keys out of the `Hazard` class by defining constants. * Rename `time` to `event` in `coordinate_vars` argument, as CLIMADA operates on events. * Rename `load_data_or_default` to `load_from_xarray_or_return_default`. * Rename `identifier` to `default_key`. * Update docstrings and extend comments.
Configuration menu - View commit details
-
Copy full SHA for 1be9772 - Browse repository at this point
Copy the full SHA 1be9772View commit details
Commits on Aug 8, 2022
-
Skip test for now as it is unclear how this can be tested
Configuration menu - View commit details
-
Copy full SHA for ccec87f - Browse repository at this point
Copy the full SHA ccec87fView commit details
Commits on Sep 29, 2022
-
Merge branch 'develop' into 487-add-classmethod-to-hazard-for-reading…
…-raster-like-data-from-netcdf-file
Configuration menu - View commit details
-
Copy full SHA for c19f9ea - Browse repository at this point
Copy the full SHA c19f9eaView commit details
Commits on Oct 5, 2022
-
Fix bug where wrong Hazard attribute was set
Type: Hazard.unit was set instead of Hazard.units. This was not catched by the test because they were consistent.
Configuration menu - View commit details
-
Copy full SHA for 07e8bf7 - Browse repository at this point
Copy the full SHA 07e8bf7View commit details
Commits on Oct 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 84b0795 - Browse repository at this point
Copy the full SHA 84b0795View commit details -
Configuration menu - View commit details
-
Copy full SHA for a72112c - Browse repository at this point
Copy the full SHA a72112cView commit details -
Configuration menu - View commit details
-
Copy full SHA for d777785 - Browse repository at this point
Copy the full SHA d777785View commit details -
Configuration menu - View commit details
-
Copy full SHA for d36bcc2 - Browse repository at this point
Copy the full SHA d36bcc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68c1459 - Browse repository at this point
Copy the full SHA 68c1459View commit details
Commits on Oct 7, 2022
-
Merge branch 'develop' into 487-add-classmethod-to-hazard-for-reading…
…-raster-like-data-from-netcdf-file
Configuration menu - View commit details
-
Copy full SHA for 2cffc9a - Browse repository at this point
Copy the full SHA 2cffc9aView commit details
Commits on Oct 14, 2022
-
Promote single-valued coordinates to dimensions
In Hazard.from_raster_xarray, promote coordinates to dimensions if they have a single value. This enables loading datasets with lower dimensions as long as the "missing" dimensions are specified as coordinates. Update docstring and tests.
Configuration menu - View commit details
-
Copy full SHA for 1ff075d - Browse repository at this point
Copy the full SHA 1ff075dView commit details -
Merge branch '487-add-classmethod-to-hazard-for-reading-raster-like-d…
…ata-from-netcdf-file' of https://github.com/CLIMADA-project/climada_python into 487-add-classmethod-to-hazard-for-reading-raster-like-data-from-netcdf-file
Configuration menu - View commit details
-
Copy full SHA for 1eea94c - Browse repository at this point
Copy the full SHA 1eea94cView commit details