-
Notifications
You must be signed in to change notification settings - Fork 34
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
add VLType and CompoundType, commit complex compound type to file #227
Conversation
@ZedThree FYI, this is the first serve of adding the missing user types (committed types) to h5netcdf as well as making it compatible with nc-complex. |
LGTM! I think your xarray tests are failing because, somewhat ironically, they actually work and you expect them to fail! 😄 Just to note that nc-complex supports a wider variety of conventions for complex numbers, but I think it's absolutely fine for h5netcdf to only support the h5py/transient compound type and the explicit |
Thanks for taking a look here, much appreciated.
Yes, they are actually from xarray's own test-suite, which expect h5netcdf to error here 😀
Sure, we can think about aligning h5netcdf's legacyapi to what netcdf4-python supports. |
This would be neat, but much less important than your work here to ensure that currently released (and older) versions of netcdf will be able to read files created by h5netcdf. This is a great improvement for compatibility, so thank you! |
83f734d
to
e5aa9d2
Compare
@shoyer, I'd like to merge this in the coming days. If you have time it would be great if you could take a look here. Thanks! With the work of @ZedThree over in https://github.com/PlasmaFAIR/nc-complex and this PR here, we can enable complex numbers for xarray netcdf4/h5netcdf backends. |
I could not get around to check this in more detail in this gist: https://gist.github.com/kmuehlbauer/1f6f8a61ad5b0a7693ae08154060b790 It looks like we could get away by just committing the complex compound type to file as nectdf-c/netcdf4-python does instead of relying on the transient hdf5 type. This could also be considered as bug. That means we could significantly simplify this PR. We would not have to use the |
@shoyer Thanks for the immediate review. I've fixed the mentioned issues and applied your change for exception handling. Sure, xarray's h5netcdf tests (https://github.com/h5netcdf/h5netcdf/actions/runs/7597039010/job/20691426586?pr=227) are breaking, because of the complex compatibility tests over there. This will immediately lead to breaking nightly tests over at xarray, if this PR is merged. I'm ready to take action over at xarray. |
Unfortunately there are still some inconsistencies in the correct retrieval of the committed type. I'll push more changes later. |
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've added some comments for better understanding.
This seems to work now as intended. I'll split out the changes regarding EnumType and shared user type into a separate PR's. This will finally wrap up VLType and CompoundType. |
f1c9b64
to
6dc11d3
Compare
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 think this is ready for final review. I really like to get this in sometime next week, and get a release out. |
So, this is unfortunately not finished yet. There are issues with compound type containing strings. This is done by array of chars under the hood, which needs some special casing to be transparent in h5netcdf. See: Unidata/netcdf4-python#773 I'll set this PR to draft until this is figured out. |
113417a
to
5968e2c
Compare
fac3d25
to
659f57a
Compare
LGTM! Thanks @kmuehlbauer ! |
CHANGELOG.rst
see #228 for transient vs committed types