Skip to content

Commit 1725424

Browse files
committed
reorg storage
1 parent 74a365b commit 1725424

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

docs/quickstart.rst

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,18 @@ Persistent Storage
122122
------------------
123123

124124
Zarr supports persistent storage to disk or cloud-compatible backends. While examples above
125-
utilized a :class:`zarr.storage.LocalStore`, a number of other storage options are available,
126-
including the :class:`zarr.storage.ZipStore` and :class:`zarr.storage.FsspecStore`::
125+
utilized a :class:`zarr.storage.LocalStore`, a number of other storage options are available.
126+
127+
Zarr integrates seamlessly with cloud object storage such as Amazon S3 and Google Cloud Storage
128+
using external libraries like `s3fs <https://s3fs.readthedocs.io>`_ or
129+
`gcsfs <https://gcsfs.readthedocs.io>`_::
130+
131+
>>> import s3fs # doctest: +SKIP
132+
>>>
133+
>>> z = zarr.create_array("s3://example-bucket/foo", mode="w", shape=(100, 100), chunks=(10, 10)) # doctest: +SKIP
134+
>>> z[:, :] = np.random.random((100, 100)) # doctest: +SKIP
135+
136+
A single-file store can also be created using the the :class:`zarr.storage.ZipStore`::
127137

128138
>>> # Store the array in a ZIP file
129139
>>> store = zarr.storage.ZipStore("data/example-3.zip", mode='w')
@@ -142,7 +152,7 @@ including the :class:`zarr.storage.ZipStore` and :class:`zarr.storage.FsspecStor
142152
>>> # the ZipStore must be explicitly closed
143153
>>> store.close()
144154

145-
To open an existing array::
155+
To open an existing array from a ZIP file::
146156

147157
>>> # Open the ZipStore in read-only mode
148158
>>> store = zarr.storage.ZipStore("data/example-3.zip", read_only=True)
@@ -165,20 +175,6 @@ To open an existing array::
165175
[0.4335856 , 0.7565437 , 0.7828931 , ..., 0.48119593, 0.66220033,
166176
0.6652362 ]], shape=(100, 100), dtype=float32)
167177

168-
Cloud Storage Backends
169-
~~~~~~~~~~~~~~~~~~~~~~
170-
171-
Zarr integrates seamlessly with cloud storage such as Amazon S3 and Google Cloud Storage
172-
using external libraries like `s3fs <https://s3fs.readthedocs.io>`_ or
173-
`gcsfs <https://gcsfs.readthedocs.io>`_.
174-
175-
For example, to use S3::
176-
177-
>>> import s3fs # doctest: +SKIP
178-
>>>
179-
>>> z = zarr.create_array("s3://example-bucket/foo", mode="w", shape=(100, 100), chunks=(10, 10)) # doctest: +SKIP
180-
>>> z[:, :] = np.random.random((100, 100)) # doctest: +SKIP
181-
182178
Read more about Zarr's storage options in the :ref:`User Guide <user-guide-storage>`.
183179

184180
Next Steps

0 commit comments

Comments
 (0)