-
Notifications
You must be signed in to change notification settings - Fork 124
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
Impact read hdf5 fails if hazard event name is not a string #807
Comments
This is not an issue with writing, but with reading: climada_python/climada/engine/impact.py Line 1246 in e412222
Because "event_name" was always specified as a list of strings, I wrote code that only reads it as such. We could adapt that, too. |
Well, the fact is that we do not enforce type on the impact objects. So, either we need to change that or update the over-restrictive read method. |
How to continue here? Do we want to read other values than strings or do we want a better error message if the values are not strings? What do we do in this case? Continue by setting "default" event names or only throw an error? |
Thanks, @peanutfun for the reminder. To be honest I don't think I understand enough about to implications of any of the options you guys mentioned to give an educated opinion on this. I'd be happy to make a PR for any option you think is best though! |
@chahank This does not seem to be a pressing issue so I would like us to take a pragmatic decision here and resolve it. |
Agreed! |
#894 proposes a solution that reads other data types, but issues a warning that |
Decision from discussion in #894:
|
solved by #894 |
Similarly to issue #789 , saving an impact to hdf5 if the hazard name is not a list of strings causes issues when the data is read again.
Precisely, the attribute
impact.event_name
must be a list of strings at the moment of saving to hdf5impact.to_hdf5
, or the reading methodimpact.from_hdf5
should be able to handle non-numerical values.The text was updated successfully, but these errors were encountered: