Skip to content
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

Hazard.from_raster_xarray stores native values of dates in Hazard.event_name #789

Closed
peanutfun opened this issue Oct 10, 2023 · 3 comments
Closed
Assignees
Labels

Comments

@peanutfun
Copy link
Member

The current implementation uses the exact date/event values as Hazard.event_name if no explicit event names can be found in the dataset. This causes issues when trying to store the hazard object or a related impact object as H5 file. We should somehow make sure that Hazard.event_name is sanitized. Suggestions:

  • Using a different default value for event_name including none at all (empty list)
  • Trying to cast any time information to a string, e.g. via pandas.Timestamp(x).isoformat()
@peanutfun peanutfun added the bug label Oct 10, 2023
@peanutfun peanutfun self-assigned this Oct 10, 2023
@chahank
Copy link
Member

chahank commented Oct 18, 2023

Good idea! Another suggestion would be to just duplicate the even_id as strings in the event_name. This way, one can still use the methods based on event name selection easily...

@sarah-hlsn
Copy link
Collaborator

Does this refer to Hazard.from_xarray_raster or is there another method called Hazard.from_raster_xarray?

@peanutfun
Copy link
Member Author

Fixed by #795

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants