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
* docs: use 'ZIP archive' instead of 'zip file'; clarify utility of caching in s3 + ZIP example; style
* docs: update release notes, correct spelling of greg lee's name in past release notes, and fix markup in past release notes
* docs: use 'ZIP archive' instead of 'zip file'; clarify utility of caching in s3 + ZIP example; style
* docs: update release notes, correct spelling of greg lee's name in past release notes, and fix markup in past release notes
Copy file name to clipboardExpand all lines: docs/tutorial.rst
+14-13Lines changed: 14 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -774,7 +774,7 @@ the following code::
774
774
775
775
Any other compatible storage class could be used in place of
776
776
:class:`zarr.storage.DirectoryStore` in the code examples above. For example,
777
-
here is an array stored directly into a Zip file, via the
777
+
here is an array stored directly into a ZIP archive, via the
778
778
:class:`zarr.storage.ZipStore` class::
779
779
780
780
>>> store = zarr.ZipStore('data/example.zip', mode='w')
@@ -798,12 +798,12 @@ Re-open and check that data have been written::
798
798
[42, 42, 42, ..., 42, 42, 42]], dtype=int32)
799
799
>>> store.close()
800
800
801
-
Note that there are some limitations on how Zip files can be used, because items
802
-
within a Zip file cannot be updated in place. This means that data in the array
801
+
Note that there are some limitations on how ZIP archives can be used, because items
802
+
within a ZIP archive cannot be updated in place. This means that data in the array
803
803
should only be written once and write operations should be aligned with chunk
804
804
boundaries. Note also that the ``close()`` method must be called after writing
805
805
any data to the store, otherwise essential records will not be written to the
806
-
underlying zip file.
806
+
underlying ZIP archive.
807
807
808
808
Another storage alternative is the :class:`zarr.storage.DBMStore` class, added
809
809
in Zarr version 2.2. This class allows any DBM-style database to be used for
@@ -846,7 +846,7 @@ respectively require the `redis-py <https://redis-py.readthedocs.io>`_ and
846
846
`pymongo <https://api.mongodb.com/python/current/>`_ packages to be installed.
847
847
848
848
For compatibility with the `N5 <https://github.com/saalfeldlab/n5>`_ data format, Zarr also provides
849
-
an N5 backend (this is currently an experimental feature). Similar to the zip storage class, an
849
+
an N5 backend (this is currently an experimental feature). Similar to the ZIP storage class, an
850
850
:class:`zarr.n5.N5Store` can be instantiated directly::
851
851
852
852
>>> store = zarr.N5Store('data/example.n5')
@@ -1000,12 +1000,13 @@ separately from Zarr.
1000
1000
1001
1001
.. _tutorial_copy:
1002
1002
1003
-
Accessing Zip Files on S3
1004
-
~~~~~~~~~~~~~~~~~~~~~~~~~
1003
+
Accessing ZIP archives on S3
1004
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1005
1005
1006
-
The built-in `ZipStore` will only work with paths on the local file-system, however
1007
-
it is also possible to access ``.zarr.zip`` data on the cloud. Here is an example of
1008
-
accessing a zipped Zarr file on s3:
1006
+
The built-in :class:`zarr.storage.ZipStore` will only work with paths on the local file-system; however
1007
+
it is possible to access ZIP-archived Zarr data on the cloud via the `ZipFileSystem <https://filesystem-spec.readthedocs.io/en/latest/_modules/fsspec/implementations/zip.html>`_
1008
+
class from ``fsspec``. The following example demonstrates how to access
1009
+
a ZIP-archived Zarr group on s3 using `s3fs <https://s3fs.readthedocs.io/en/latest/>`_ and ``ZipFileSystem``:
1009
1010
1010
1011
>>> s3_path ="s3://path/to/my.zarr.zip"
1011
1012
>>>
@@ -1014,15 +1015,15 @@ accessing a zipped Zarr file on s3:
1014
1015
>>> fs = ZipFileSystem(f, mode="r")
1015
1016
>>> store = FSMap("", fs, check=False)
1016
1017
>>>
1017
-
>>> #cache is optional, but may be a good idea depending on the situation
1018
+
>>> #caching may improve performance when repeatedly reading the same data
0 commit comments