-
Notifications
You must be signed in to change notification settings - Fork 262
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
Zarr generation creates a unexpected array value for fill_value #2008
Comments
Good catch. I will have to check, but in netcdf. the value of the attribute is actually a sequence of values, possibly of size 1. I did the translation directly. Instead, I should see if the attribute has a single value and then stored it as such. |
Also, this applies because of the netcdf _FillValue attribute. |
DennisHeimbigner
added a commit
to DennisHeimbigner/netcdf-c
that referenced
this issue
Jun 5, 2021
re: Unidata#2008 The fill_value key in a .zarray should have a single value, but it currently has a value that is a 1 element array. Fix is to pull out the single element. This occurred because the fill_value is taken from the _FillValue attribute, and all attributes are stored as arrays, of length 1 in this case. Misc. other changes: 1. Fix bug in testpathcvt caused by the way various shells handle backslash escapes. 2. Fix bug in testauth where test for MSVC is wrong.
DennisHeimbigner
added a commit
to DennisHeimbigner/netcdf-c
that referenced
this issue
Jun 5, 2021
re: Unidata#2008 The fill_value key in a .zarray should have a single value, but it currently has a value that is a 1 element array. Fix is to pull out the single element. This occurred because the fill_value is taken from the _FillValue attribute, and all netcdf attributes are stored as arrays, of length 1 in this case. In a related change, any attribute with length 1 is now stored in .zattrs as a singleton rather than an array of length 1. This make the generated Zarr more consistent with other Zarr implementations. Misc. other changes: 1. Fix bug in testpathcvt caused by the way various shells handle backslash escapes. 2. Fix bug in testauth where test for MSVC is wrong.
Fixed by PR #2017 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version: libnetcdf 4.8.0, built on Ubuntu 20.04 with NCZarr support
Given simple.cdl:
~/install-netcdf-4.8.0/bin/ncgen -4 -lb -o "file://simple_zarr#mode=nczarr,file" simple.cdl
generates asimple_zarr/test/.zarray
file with following content :"fill_value": [-32767]
doesn't match what the Python Zarr reference implementation does. It would generate"fill_value": -32767
. The spec at https://zarr.readthedocs.io/en/stable/spec/v2.html#fill-value-encoding is admittedly a bit vague about that, but I wouldn't expect an array from reading it.The text was updated successfully, but these errors were encountered: