Improve impact calc error messages when there is a mismatch of impf ids between exposures and impfset by luseverin · Pull Request #863 · CLIMADA-project/climada_python

added 5 commits

March 22, 2024 08:55
…pfset in ImpactCalc.impact()
…pfset and exposures in ImpactCalc.impact()
…set and exposures in ImpactCalc.impact()

chahank

@luseverin

…est_error_handling_mismatch_impf_ids

@luseverin

@luseverin

chahank

chahank

emanuel-schmid

emanuel-schmid

emanuel-schmid

gdeskos pushed a commit to gdeskos/climada_python that referenced this pull request

Sep 16, 2024
…ds between exposures and impfset (CLIMADA-project#863)

* Add error handling for missmatching impf ids between exposures and impfset in ImpactCalc.impact()

* Clarify error message for handling of mismatching impf ids between impfset and exposures in ImpactCalc.impact()

* Add unit test for error handling of mismatchin impf ids between impf set and exposures in ImpactCalc.impact()

* Make code compliant with PEP8

* Change ambiguous variable names

* Add impact function in the impf set but not in the exposure for the test_error_handling_mismatch_impf_ids

* Add name to authors's list

* Add changes to changelog

* Use assertRaises instead of assertEqual to test the error handling

* Refine error message so that it provides users with the ids of missing impfs

* Initiate dummy impf in testing function directly setting its attributes

* Correct for pylint warnings for too long lines

---------

Co-authored-by: luseverin <luca.severino@usys.ethz.ch>