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

Catch exception for old boolean type #483

Open
achilleas-k opened this issue Oct 22, 2020 · 1 comment
Open

Catch exception for old boolean type #483

achilleas-k opened this issue Oct 22, 2020 · 1 comment
Labels
Milestone

Comments

@achilleas-k
Copy link
Member

Since v1.2 (2016) the file representation for boolean types has changed. Files created before this version can't be read using h5py; the old representation is not compatible with h5py at all. This hasn't been an issue in general, but it came up recently (G-Node/nix-odML-converter#26) during some old file conversions. The way to fix these would be to use NIX (C++) or HDF5 directly to change the format of older files. Since we can't automate that with NIXPy, we should catch the exception and provide a more useful error message.

@achilleas-k achilleas-k added this to the Version 1.5 milestone Oct 22, 2020
@achilleas-k
Copy link
Member Author

Since h5py 2.10, bitfields can be read but the type needs to be explicitly set: https://docs.h5py.org/en/latest/whatsnew/2.10.html#new-features

with dset.astype(numpy.bool):
    arr = dset[:]

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

No branches or pull requests

1 participant