Skip to content

DataArray encoding needs to be deleted in order to save a dataset #297

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
eric-czech opened this issue Oct 5, 2020 · 1 comment
Closed
Labels
IO Issues related to reading and writing common third-party file formats

Comments

@eric-czech
Copy link
Collaborator

We need some way for users to handle this situation (i.e. pydata/xarray#4380):

ds = sg.simulate_genotype_call_dataset(10000, 500).chunk(chunks=100)
del ds.attrs['contigs']
ds.to_zarr('/tmp/ds.zarr', mode='w')
xr.open_zarr('/tmp/ds.zarr').chunk(chunks=150).to_zarr('/tmp/ds2.zarr', mode='w')

NotImplementedError: Specified zarr chunks encoding['chunks']=(100,) for variable named 'variant_contig' 
would overlap multiple dask chunks ((150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 
150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 
150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 
150, 150, 150, 150, 150, 100),). This is not implemented in xarray yet. Consider either rechunking using 
`chunk()` or instead deleting or modifying `encoding['chunks']`.

The .encoding['chunks'] value is stale in this situation and can be ignored.

@hammer hammer added the IO Issues related to reading and writing common third-party file formats label Oct 8, 2020
@tomwhite
Copy link
Collaborator

Fixed in #392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Issues related to reading and writing common third-party file formats
Projects
None yet
Development

No branches or pull requests

3 participants