Improve impact calc error messages by leonie-villiger · Pull Request #691 · CLIMADA-project/climada_python

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@leonie-villiger

Copy link

Collaborator

@leonie-villiger leonie-villiger commented

Apr 5, 2023

edited

Loading

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 message AttributeError: 'list' has no attribute 'calc_mdr'

This PR fixes #669

PR Author Checklist

PR Reviewer Checklist

@chahank

Copy link

Member

chahank commented

Apr 6, 2023

Great solution to issue #669 ! Thanks! Just a few suggestion to make the test more efficient and clearer.

leonie-villiger reacted with thumbs up emoji

@ChrisFairless

Copy link

Collaborator

I ran into this error today. An hour later I'm here and very pleased to see this fix ✨

leonie-villiger reacted with hooray emoji

@leonie-villiger

Copy link

Collaborator Author

Thank you for the review! I think I addressed all your comments. Please merge the branch If you agree.

@chahank

Copy link

Member

chahank commented

Apr 17, 2023

Great, thanks! Ready to merge imho.

@chahank

Copy link

Member

chahank commented

Apr 17, 2023

Welcome to the authors list!

@leonie-villiger leonie-villiger merged commit c7bcf32 into develop

Apr 17, 2023

@leonie-villiger leonie-villiger deleted the feature/improve_impact_calc_error_messages branch

April 20, 2023 06:08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chahank chahank chahank left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@leonie-villiger @chahank @ChrisFairless