Closed martinvonk closed 2 years ago
I think we should add a method similar to pastastore.util.validate_names()
that runs through the dtypes of dictionary values and checks whether Pastas supports writing those to JSON.
I believe I added support for storing datetime.datetime entries in metadata in https://github.com/pastas/pastas/commit/99ca82ef87ec6aaacac225b3cfec646924d744c2.
@martinvonk, could you check if this is fixed now?
Note that the datetime entry will be converted to pastas.Timestamp on load.
Yes this is fixed now. Thanks for the heads up. I'll close the issue.
datetime
in a dictionary can't be saved when writing the pastastore to a zip file. You get the following error:TypeError: Object of type datetime is not JSON serializable
and the .zip file becomes empty.This could be solved by checking if there are
datetime.datetime
formats in the metadata when adding a stress/oseries.pandas.to_datetime()
should work or just convert to a string.