@@ -898,11 +898,11 @@ can be omitted as it will internally be set to ``'a'``.
898
898
To store variable length strings use ``dtype=object ``.
899
899
900
900
To read back a zarr dataset that has been created this way, we use the
901
- :py:func: `open_zarr ` method:
901
+ :py:func: `open_dataset ` method with `` engine="zarr" `` :
902
902
903
903
.. ipython :: python
904
904
905
- ds_zarr = xr.open_zarr (" path/to/directory.zarr" )
905
+ ds_zarr = xr.open_dataset (" path/to/directory.zarr " , engine = " zarr" )
906
906
ds_zarr
907
907
908
908
Cloud Storage Buckets
@@ -919,7 +919,7 @@ pass to xarray::
919
919
# write to the bucket
920
920
ds.to_zarr(store=gcsmap)
921
921
# read it back
922
- ds_gcs = xr.open_zarr (gcsmap)
922
+ ds_gcs = xr.open_dataset (gcsmap, engine="zarr" )
923
923
924
924
.. _Zarr : http://zarr.readthedocs.io/
925
925
.. _Amazon S3 : https://aws.amazon.com/s3/
@@ -970,12 +970,12 @@ with consolidated metadata. To write consolidated metadata, pass the
970
970
``consolidated=True `` option to the
971
971
:py:attr: `Dataset.to_zarr ` method::
972
972
973
- ds.to_zarr(' foo.zarr' , consolidated=True)
973
+ ds.to_zarr(" foo.zarr" , consolidated=True)
974
974
975
- To read a consolidated store, pass the `` consolidated= True `` option to
976
- :py:func: `open_zarr `::
975
+ To read a consolidated store, pass `` {" consolidated": True} `` to the
976
+ backend_kwargs option when using :py:func: `open_dataset ` with `` engine="zarr" ` `::
977
977
978
- ds = xr.open_zarr(' foo.zarr', consolidated= True)
978
+ ds = xr.open_dataset(" foo.zarr", engine="zarr", backend_kwargs={"consolidated": True} )
979
979
980
980
Xarray can't perform consolidation on pre-existing zarr datasets. This should
981
981
be done directly from zarr, as described in the
0 commit comments