Skip to content

to_netcdf fails for engine=h5netcdf when using dask-backed arrays #1571

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

Closed
jcmgray opened this issue Sep 12, 2017 · 2 comments
Closed

to_netcdf fails for engine=h5netcdf when using dask-backed arrays #1571

jcmgray opened this issue Sep 12, 2017 · 2 comments

Comments

@jcmgray
Copy link
Contributor

jcmgray commented Sep 12, 2017

When using dask-backed datasets/arrays it does not seem possible to use the 'h5netcdf' engine to write to disk:

import xarray as xr
ds = xr.Dataset({'a': ('x', [1, 2])}, {'x': [3, 4]}).chunk()
ds.to_netcdf("test.h5", engine='h5netcdf')

results in the error:

...

h5py/h5a.pyx in h5py.h5a.open()

KeyError: "Can't open attribute (can't locate attribute: 'dask')"

Not sure if this is a xarray or h5netcdf issue - or some inherent limitation in which case apologies!

@shoyer
Copy link
Member

shoyer commented Sep 12, 2017

Thanks for the report!

This was definitely working at one point, but it appears we did not have test coverage and then it was broken by dask/dask#2181.

I'm going to fix this on the h5netcdf side, but will leave this issue open as a reminder to write an integration test to catch issues like this.

shoyer added a commit to h5netcdf/h5netcdf that referenced this issue Sep 12, 2017
@shoyer
Copy link
Member

shoyer commented Sep 12, 2017

This should be fixed in the latest h5netcdf release (v0.4.2), which is now up on pypi (so you can install it with pip).

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

3 participants