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

The H5T_BITFIELD class should not be directly mapped to Bool #1148

Open
mkitti opened this issue Apr 11, 2024 · 1 comment
Open

The H5T_BITFIELD class should not be directly mapped to Bool #1148

mkitti opened this issue Apr 11, 2024 · 1 comment

Comments

@mkitti
Copy link
Member

mkitti commented Apr 11, 2024

#540 mapped H5T_NATIVE_B8 to Bool. However, this seems be an error. A Bool should bit a H5T_BITFIELD with a precision of 1 as described by PyTables.

H5T_BITFIELD: This class is used to represent the Bool type. Such a type must be build using a H5T_NATIVE_B8 datatype, followed by a HDF5 H5Tset_precision call to set its precision to be just 1 bit.

h5py chooses to read the class of H5T_BITFIELD as unsigned integers:
h5py/h5py#1889

@tamasgal I'm considering requiring the precision to be set to 1 to interpret the value as a Bool. Rather I think we should consider mapping H5T_NATIVE_B8 to a UInt8.

@tamasgal
Copy link
Contributor

Oh, yes, I think you are right. Mapping H5T_NATIVE_B8 to a UInt8 would make most sense to me too.

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

No branches or pull requests

2 participants