Skip to content

Commit cd0b9ef

Browse files
committed
Change open_zarr to open_dataset with engine="zarr" in io.rst
1 parent cb6d066 commit cd0b9ef

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

doc/io.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -898,11 +898,11 @@ can be omitted as it will internally be set to ``'a'``.
898898
To store variable length strings use ``dtype=object``.
899899

900900
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"``:
902902

903903
.. ipython:: python
904904
905-
ds_zarr = xr.open_zarr("path/to/directory.zarr")
905+
ds_zarr = xr.open_dataset("path/to/directory.zarr", engine="zarr")
906906
ds_zarr
907907
908908
Cloud Storage Buckets
@@ -919,7 +919,7 @@ pass to xarray::
919919
# write to the bucket
920920
ds.to_zarr(store=gcsmap)
921921
# read it back
922-
ds_gcs = xr.open_zarr(gcsmap)
922+
ds_gcs = xr.open_dataset(gcsmap, engine="zarr")
923923

924924
.. _Zarr: http://zarr.readthedocs.io/
925925
.. _Amazon S3: https://aws.amazon.com/s3/
@@ -970,12 +970,12 @@ with consolidated metadata. To write consolidated metadata, pass the
970970
``consolidated=True`` option to the
971971
:py:attr:`Dataset.to_zarr` method::
972972

973-
ds.to_zarr('foo.zarr', consolidated=True)
973+
ds.to_zarr("foo.zarr", consolidated=True)
974974

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"``::
977977

978-
ds = xr.open_zarr('foo.zarr', consolidated=True)
978+
ds = xr.open_dataset("foo.zarr", engine="zarr", backend_kwargs={"consolidated": True})
979979

980980
Xarray can't perform consolidation on pre-existing zarr datasets. This should
981981
be done directly from zarr, as described in the

0 commit comments

Comments
 (0)