You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your work on this fantastic package. I'm a new user, and the subtleties of different data stores are unfamiliar to me. I got tripped up by the fact that Zarr stores are (silently) read-only, and I think it would be helpful if this were more prominent in the docstring or zarr section of the docs.
When I try to assign values to parts of a local Zarr-backed Dataset, I get a silent failure:
In [142]: ds=xr.open_zarr('tmp.zarr', chunks=None)
In [143]: selector=dict(time='2014-06-06T01:00:00', azimuth=0, frequency=0.0)
In [144]: ds['counts'].loc[selector].valuesOut[144]: array(4294967295, dtype=uint32)
# try to assign a value here, like the example in the docs: # In [55]: ds['empty'].loc[dict(lon=260, lat=30)] = 100In [145]: ds['counts'].loc[selector].values=0# just get the same value backIn [146]: ds['counts'].loc[selector].valuesOut[146]: array(4294967295, dtype=uint32)
The answer seems to be buried in the open_zarr source code:
...
# Zarr supports a wide range of access modes, but for now xarray either# reads or writes from a store, never both. For open_zarr, we only readmode='r'zarr_store=ZarrStore.open_group(store, mode=mode,
synchronizer=synchronizer,
group=group, consolidated=consolidated)
...
Hello Xarray devs,
Thanks for your work on this fantastic package. I'm a new user, and the subtleties of different data stores are unfamiliar to me. I got tripped up by the fact that Zarr stores are (silently) read-only, and I think it would be helpful if this were more prominent in the docstring or zarr section of the docs.
When I try to assign values to parts of a local Zarr-backed Dataset, I get a silent failure:
The answer seems to be buried in the
open_zarr
source code:Expected Output
Assignment that follows the examples in the documentation.
mode='r'
in theopen_zarr
docstring would be the most helpful.I'm happy to make a PR on 1 & 3, but I'm not familiar with the reasoning behind why stores are never mixed-mode.
Thanks again!
Output of
xr.show_versions()
xarray: 0.12.3
pandas: 0.24.2
numpy: 1.16.3
scipy: 1.3.0
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.3.1
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 1.2.2
distributed: 1.28.1
matplotlib: 3.1.0
cartopy: None
seaborn: None
numbagg: None
setuptools: 41.0.1
pip: 19.1
conda: None
pytest: None
IPython: 7.5.0
sphinx: None
The text was updated successfully, but these errors were encountered: