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

Support builtin and numpy types in HDF5 #3124

Merged
merged 3 commits into from Apr 21, 2023
Merged

Support builtin and numpy types in HDF5 #3124

merged 3 commits into from Apr 21, 2023

Conversation

jl-wynen
Copy link
Member

Fixes #3056

@jl-wynen
Copy link
Member Author

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',
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, bytes, iirc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@SimonHeybrock
Copy link
Member

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.

We have so far not done any version checks on files, have we?

@jl-wynen
Copy link
Member Author

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.

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.

@SimonHeybrock
Copy link
Member

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.

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?

@jl-wynen
Copy link
Member Author

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.
If we want such a feature, we should implement support separately from this PR.

@jl-wynen jl-wynen merged commit 606af76 into main Apr 21, 2023
4 checks passed
@jl-wynen jl-wynen deleted the non-scipp-hdf5 branch April 21, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataGroup HDF5 I/O with non-scipp items
2 participants