Skip to content
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

writing datasets derived from netCDF4 with compression fails #1458

Closed
matt-long opened this issue Jun 16, 2017 · 4 comments
Closed

writing datasets derived from netCDF4 with compression fails #1458

matt-long opened this issue Jun 16, 2017 · 4 comments

Comments

@matt-long
Copy link

matt-long commented Jun 16, 2017

When I read a file with netCDF4 compression into a Dataset, a subsequent call to write the dataset using to_netcdf fails.

For instance, using data from the POP model, I can convert output to netCDF4 using NCO

$ ncks --netcdf4 --deflate 1 $file nc4-test.nc

Then in Python:

ds = xr.open_dataset('nc4-test.nc',decode_times=False,decode_coords=False)
ds.to_netcdf('test-out.nc')

The write fails with:

  File "netCDF4/_netCDF4.pyx", line 2263, in netCDF4._netCDF4.Dataset.createVariable (netCDF4/_netCDF4.c:18764)
  File "netCDF4/_netCDF4.pyx", line 3235, in netCDF4._netCDF4.Variable.__init__ (netCDF4/_netCDF4.c:31564)
RuntimeError: NetCDF: Bad chunk sizes.

If I include format = NETCDF3_64BIT, the write completes.

This seems like a bug.

Example dataset: ftp://ftp.ucar.edu/pub/cgd/mclong/misc/nc4-test.nc

@shoyer
Copy link
Member

shoyer commented Jun 17, 2017

Thanks for the report, I can reproduce this behavior, so I'm marking this as a bug. For completeness I've attached your file below:
test-out.nc.zip

@shoyer shoyer added the bug label Jun 17, 2017
@shoyer
Copy link
Member

shoyer commented Jun 17, 2017

This looks related to #1225

@stale
Copy link

stale bot commented Aug 1, 2019

In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity

If this issue remains relevant, please comment here or remove the stale label; otherwise it will be marked as closed automatically

@stale stale bot added the stale label Aug 1, 2019
@shoyer
Copy link
Member

shoyer commented Aug 1, 2019

This works now

@shoyer shoyer closed this as completed Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants