You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When saving a variable as a NetCDF coordinate variable (in the CF sense a variable with the same name as its dimension) you get a serialization warning:
SerializationWarning: saving variable x with floating point data as an integer dtype without any _FillValue to use for NaNs
CF coordinate variables are not supposed to have a _FillValue defined:
This stackoverflow answer says I can set fill value to None to not have a fill value for the variable, but it doesn't seem to change anything regarding the warning:
What happened?
When saving a variable as a NetCDF coordinate variable (in the CF sense a variable with the same name as its dimension) you get a serialization warning:
CF coordinate variables are not supposed to have a _FillValue defined:
https://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/cf-conventions.html#missing-data
What did you expect to happen?
For variables that are CF coordinate variables I expect no warning. Or if I explicitly set the
_FillValue
toNone
then I would expect no warning.Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
@kmuehlbauer added this check in #7719
This stackoverflow answer says I can set fill value to None to not have a fill value for the variable, but it doesn't seem to change anything regarding the warning:
https://stackoverflow.com/a/45696423/433202
Environment
INSTALLED VERSIONS
commit: None
python: 3.12.8 | packaged by conda-forge | (main, Dec 5 2024, 14:24:40) [GCC 13.3.0]
python-bits: 64
OS: Linux
OS-release: 6.12.10-76061203-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.14.3
libnetcdf: 4.9.2
xarray: 2025.4.0
pandas: 2.2.3
numpy: 2.2.5
scipy: 1.15.2
netCDF4: 1.7.2
pydap: None
h5netcdf: 1.6.1
h5py: 3.13.0
zarr: 2.18.7
cftime: 1.6.4
nc_time_axis: None
iris: None
bottleneck: 1.4.2
dask: 2025.4.1
distributed: 2025.4.1
matplotlib: 3.10.1
cartopy: 0.24.0
seaborn: None
numbagg: None
fsspec: 2025.3.2
cupy: None
pint: 0.24.4
sparse: None
flox: None
numpy_groupies: None
setuptools: 80.1.0
pip: 25.1
conda: 25.3.1
pytest: 8.3.5
mypy: 1.15.0
IPython: 9.2.0
sphinx: 8.2.3
The text was updated successfully, but these errors were encountered: