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
Support builtin and numpy types in HDF5 #3124
Conversation
How do we handle the version of the file format here? Files with these entries cannot be loaded by an old scipp version. But old files continue to work. |
'numpy float32': np.float32(0.031), | ||
'boolean': True, | ||
'numpy bool_': np.bool_(False), | ||
'string': 'a string for testing', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have seen NeXus files that use bytesrings, can we support that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by bytestring? Python's bytes
? h5py seems to store str
as bytes
. This is why the loader calls decode
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, bytes
, iirc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
We have so far not done any version checks on files, have we? |
We encode a version in the file but we don't actually check it for some reason. |
It was added as a way of keeping that option open in the future. Maybe we should? |
Unfortunately, it stores the scipp version not a version of the format. As far as I can tell, when loading a file with an old version, there is no way to check if the file comes from a new, incompatible version of scipp. |
411826c
to
0288eb8
Compare
Fixes #3056