-
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
cannot set _FillValue attribute for VLEN or compound variable #730
Comments
For example, a good choice for |
The C-lib doesn't support fill values for non-string vlens and compound variables. It might work for vlen strings (NC_STRING), let me have a look.... |
What about setting the Currently, overriding netcdf4-python/netCDF4/_netCDF4.pyx Lines 3864 to 3867 in 967da7e
|
Well, there's this:
Given the wording in Appendix A I don't think the python wrapper should be playing games here. @WardF anything to add? |
You can set _FillValue by hand and it is interpreted by the C library; you don't have to use |
Pull request #732 allows _FillValue to be set for vlen string variables using the fill_value createVariable kwarg. Still cannot be set for non-string vlens and compound variables though. |
@jswhit Awesome, the possibility of setting fill-value for vlen strings would solve the major issue here. |
Can you give it a try and let me know if it does what you need? |
@jswhit I can give it a try, but I would trust a unit test more than my anecdotal experience :) |
Yes, it works -- even with automatic decoding of array values matching the fill-value into the appropriate missing value!
|
pull request merged. |
Is this an intrinsic limitation of netCDF-C, or simply something that hasn't been wrapped yet?
I don't need the aspect of filling in default values in a Variable, but I would like to be able to set
_FillValue
to indicate values that should be treated as missing when read from disk.My use case is supporting arrays of (unicode) strings with missing values in xarray.
The text was updated successfully, but these errors were encountered: