Improve impact calc error messages by leonie-villiger · Pull Request #691 · CLIMADA-project/climada_python
Navigation Menu
{{ message }}
CLIMADA-project / climada_python Public
- Notifications You must be signed in to change notification settings
- Fork 151
Merged
leonie-villiger merged 6 commits intodevelopfrom
Apr 17, 2023Merged
Improve impact calc error messages#691
leonie-villiger merged 6 commits intodevelopfrom
Improve impact calc error messages#691
leonie-villiger merged 6 commits intodevelopfrom
Conversation
Copy link
Collaborator
Changes proposed in this PR:
ImpactCalc.impact(exposures, impfset, hazard) checks that
- exposures refers to impact functions for the given hazard type
- impfset contains impact functions for the given hazard type.
In case of mismatching hazard types, a comprehensible error message is produced. Currently, these cases result in the cryptic error messageAttributeError: 'list' has no attribute 'calc_mdr'
This PR fixes #669
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
leonie-villiger added 3 commits
April 5, 2023 17:07chahank reviewed Apr 6, 2023
climada/engine/test/test_impact_calc.py
Outdated
Show resolved
Hide resolved
climada/engine/test/test_impact_calc.py Outdated Show resolved Hide resolved
chahank reviewed Apr 6, 2023
climada/engine/test/test_impact_calc.py
Show resolved
Hide resolved
climada/engine/test/test_impact_calc.py Show resolved Hide resolved
chahank reviewed Apr 6, 2023
climada/engine/test/test_impact_calc.py
Outdated
Show resolved
Hide resolved
climada/engine/test/test_impact_calc.py Outdated Show resolved Hide resolved
chahank reviewed Apr 6, 2023
climada/engine/test/test_impact_calc.py
Outdated
Show resolved
Hide resolved
climada/engine/test/test_impact_calc.py Outdated Show resolved Hide resolved
Copy link
Member
chahank
commented
Apr 6, 2023
chahank commented
Apr 6, 2023Great solution to issue #669 ! Thanks! Just a few suggestion to make the test more efficient and clearer.
Copy link
Collaborator
ChrisFairless
commented
Apr 14, 2023
ChrisFairless commented
Apr 14, 2023I ran into this error today. An hour later I'm here and very pleased to see this fix ✨
Copy link
Collaborator Author
leonie-villiger
commented
Apr 17, 2023
leonie-villiger commented
Apr 17, 2023Thank you for the review! I think I addressed all your comments. Please merge the branch If you agree.
leonie-villiger
requested a review
from chahank
chahank reviewed Apr 17, 2023
climada/engine/test/test_impact_calc.py
Outdated
Show resolved
Hide resolved
climada/engine/test/test_impact_calc.py Outdated Show resolved Hide resolved
chahank reviewed Apr 17, 2023
climada/engine/test/test_impact_calc.py
Outdated
Show resolved
Hide resolved
climada/engine/test/test_impact_calc.py Outdated Show resolved Hide resolved
chahank reviewed Apr 17, 2023
climada/engine/test/test_impact_calc.py
Outdated
Show resolved
Hide resolved
climada/engine/test/test_impact_calc.py Outdated Show resolved Hide resolved
chahank reviewed Apr 17, 2023
climada/engine/test/test_impact_calc.py
Outdated
Show resolved
Hide resolved
climada/engine/test/test_impact_calc.py Outdated Show resolved Hide resolved
leonie-villiger added 2 commits
April 17, 2023 09:41Copy link
Member
chahank
commented
Apr 17, 2023
chahank commented
Apr 17, 2023Great, thanks! Ready to merge imho.
Copy link
Member
chahank
commented
Apr 17, 2023
chahank commented
Apr 17, 2023Welcome to the authors list!
leonie-villiger
merged commit
c7bcf32
into
develop
leonie-villiger
mentioned this pull request
leonie-villiger
deleted the
feature/improve_impact_calc_error_messages
branch
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment