-
Notifications
You must be signed in to change notification settings - Fork 125
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
Require definition of hazard type for all impact functions #686
Comments
Out of curiosity: Why do we want to require this? Hazards also may have an empty ( |
The reason is that in practice Hazards always have a type. Now it is rather confusing for users in so far that they in practice must define the correct hazard type for each impact function, even though the code does not require it. In practice, this often leads to cryptic error messages in the impact or cost benefit computations. Rather than introducing many checks in said computations, I find it better to make hay_type obligatory. Also, note that it is not a restriction as you can always choose it to be "". Furthermore, note that in #675 did 2 things: a) allow the user to define a hazard type for |
I see that a) makes a lot of sense, and since you introduced b), I also understand that for consistency, the The main issue about error messages is that climada_python/climada/hazard/base.py Line 2523 in e26f900
|
Good points. For the error message we already opened the issue #669 and @leonie-villiger is working on a solution. |
Overall, I get from your comments that we're statisfied if the error messages are improved and don`t need to make haz_type mandatory for all impact functions. In that case I will close the issue again (please aprove with a thumbs up)?! |
I would keep the issue open to remind us of the discussion as this will likely pop up again in the near future. |
In pull request
https://github.com/CLIMADA-project/climada_python/pull/675
we addedhaz_type
as a requirement for impact functions generated throughfrom_sigmoid_impf
orfrom_step_imp
. In the initialization of theImpactFunc
, however,haz_type
is optional. We should make this consistent.See also the following discussion #675 (comment)
The text was updated successfully, but these errors were encountered: