issues: 340192831
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
340192831 | MDU6SXNzdWUzNDAxOTI4MzE= | 2278 | can't store zarr after open_zarr and isel | 11750960 | closed | 0 | 10 | 2018-07-11T10:59:23Z | 2019-05-17T14:03:38Z | 2018-08-14T03:46:34Z | CONTRIBUTOR | Code Sample, a copy-pastable example if possibleThis works fine: ```python nx, ny, nt = 32, 32, 64 ds = xr.Dataset({}, coords={'x':np.arange(nx),'y':np.arange(ny), 't': np.arange(nt)}) ds = ds.assign(v=ds.tnp.cos(np.pi/180./100ds.x)np.cos(np.pi/180./50ds.y)) ds = ds.chunk({'t': 1, 'x': nx/2, 'y': ny/2}) ds.isel(t=0).to_zarr('data_t0.zarr', mode='w') ``` But if I store, reload and select, I cannot store:
Error message ends with: ``` ~/.miniconda3/envs/equinox/lib/python3.6/site-packages/xarray/backends/zarr.py in _extract_zarr_variable_encoding(variable, raise_on_invalid) 181 182 chunks = _determine_zarr_chunks(encoding.get('chunks'), variable.chunks, --> 183 variable.ndim) 184 encoding['chunks'] = chunks 185 return encoding ~/.miniconda3/envs/equinox/lib/python3.6/site-packages/xarray/backends/zarr.py in _determine_zarr_chunks(enc_chunks, var_chunks, ndim) 112 raise ValueError("zarr chunks tuple %r must have same length as " 113 "variable.ndim %g" % --> 114 (enc_chunks_tuple, ndim)) 115 116 for x in enc_chunks_tuple: ValueError: zarr chunks tuple (1, 16, 16) must have same length as variable.ndim 2 ``` Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2278/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |