Skip to content
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

Catch case where new Hazard fraction is unintentionally zero #869

Merged
merged 6 commits into from
Apr 15, 2024

Conversation

peanutfun
Copy link
Member

@peanutfun peanutfun commented Apr 10, 2024

Changes proposed in this PR:

  • Throw an error when selecting a part of the hazard where the fraction is zero everywhere, but only if it has had non-zero entries before.

This PR fixes #866

PR Author Checklist

PR Reviewer Checklist

@peanutfun peanutfun requested a review from chahank April 10, 2024 13:26
climada/hazard/base.py Outdated Show resolved Hide resolved
climada/hazard/base.py Outdated Show resolved Hide resolved
@peanutfun peanutfun requested a review from chahank April 12, 2024 10:11
@chahank
Copy link
Member

chahank commented Apr 12, 2024

All good, but weirdly some unit test for plotting are failing ... I have not yet understood were the failure comes from.

@chahank
Copy link
Member

chahank commented Apr 15, 2024

There remains an error with the compatibility with Petals, but I think this is unrelated. Good to merge!

@peanutfun
Copy link
Member Author

Yes, the error is related to the centroids PRs. Will merge.

@peanutfun peanutfun merged commit f88ecbd into develop Apr 15, 2024
11 of 12 checks passed
@emanuel-schmid
Copy link
Collaborator

Very well. Many thanks! 🙌

@emanuel-schmid emanuel-schmid deleted the error-if-selected-fraction-is-zero branch April 30, 2024 08:27
gdeskos pushed a commit to gdeskos/climada_python that referenced this pull request Sep 16, 2024
…-project#869)

* Catch case where new Hazard fraction is unintentionally zero
* Eliminate zeros in fraction matrix before selecting
* Update CHANGELOG.md
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