Separate Hazard xarray reader into its own module by peanutfun · Pull Request #1063 · CLIMADA-project/climada_python
Conversation
Changes proposed in this PR:
- Move code of
Hazard.from_raster_xarrayinto a separate module. This avoids an excessively long and complicated single function. - Deprecate
Hazard.from_raster_xarray_file. The module separation lets us handle files and datasets elegantly without a separate method. - Minimal adjustments to the tests. All should still work like before.
PR Author Checklist
- Read the Contribution Guide
- Correct target branch selected (if unsure, select
develop) - Descriptive pull request title added
- Source branch up-to-date with target branch
- Documentation updated
- Tests updated
- Tests passing
- No new linter issues
- Changelog updated
PR Reviewer Checklist
- Read the Contribution Guide
- CLIMADA Reviewer Checklist passed
- Tests passing
- No new linter issues
peanutfun
marked this pull request as ready for review
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Much cleaner now. Many thanks.
I've pushed minor cosmetic changes to io.py and marked xarray functions that could also be private. I'm not sure whether they have a use outside of that module. But it doesn't matter much.
@emanuel-schmid I marked all free functions of the module as private. Thanks for the review and cosmetic updates! Merging now...
This file contains hidden or 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