disdrodb icon indicating copy to clipboard operation
disdrodb copied to clipboard

netCDF zlib compression problem with netCDF4 >= 1.6.0

Open ghiggi opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

With the current implementation, there is no problem writing netCDF4 as long as the netCDF4 package version is <1.6.0.

With netCDF4>=1.6.0, the zlib: True field of the encoding dictionary is not accepted anymore. With netCDF4>=1.6.0, the field has to be changed with compression="zlib" . This a back-ward incompatibility.

Expected Behavior

The code has to be adapted to the netCDF version in order to not restrict the netCDF package version!

Relevant docs:

  • https://github.com/Unidata/netcdf4-python/blob/master/Changelog#L35
  • https://docs.xarray.dev/en/stable/generated/xarray.Dataset.to_netcdf.html
  • https://unidata.github.io/netcdf4-python/

ghiggi avatar Oct 26 '22 11:10 ghiggi

Need to wait for an upstream change in xarray: https://github.com/pydata/xarray/issues/6929 and https://github.com/pydata/xarray/pull/6981

ghiggi avatar Oct 31 '22 08:10 ghiggi