Skip to content

Conversation

@peanutfun
Copy link
Member

@peanutfun peanutfun commented Jun 18, 2025

Changes proposed in this PR:

  • Move code of Hazard.from_raster_xarray into 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

PR Reviewer Checklist

@peanutfun peanutfun marked this pull request as ready for review June 19, 2025 09:19
@peanutfun
Copy link
Member Author

Tests fail only in Petals, but unrelated to this PR, see CLIMADA-project/climada_petals#177

@peanutfun peanutfun requested a review from spjuhel August 11, 2025 12:58
Copy link
Collaborator

@emanuel-schmid emanuel-schmid left a comment

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.

@peanutfun
Copy link
Member Author

@emanuel-schmid I marked all free functions of the module as private. Thanks for the review and cosmetic updates! Merging now...

@peanutfun peanutfun merged commit 769cdd2 into develop Aug 29, 2025
19 checks passed
@emanuel-schmid emanuel-schmid deleted the hazard-xarray-module branch September 4, 2025 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants