Skip to content

Commit 4130c54

Browse files
committed
respond to outstanding reviews
1 parent 22a5705 commit 4130c54

File tree

7 files changed

+47
-47
lines changed

7 files changed

+47
-47
lines changed

docs/user-guide/arrays.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ useful. E.g.:
123123
zarr.load('data/example-3.zarr')
124124
125125
Please note that there are a number of other options for persistent array
126-
storage, see the section on :ref:`tutorial_storage` below.
126+
storage, see the :ref:`tutorial_storage` guide for more details.
127127

128128
.. _tutorial_resize:
129129

@@ -367,7 +367,7 @@ That is, the following two calls are equivalent:
367367
Indexing with a mask array
368368
~~~~~~~~~~~~~~~~~~~~~~~~~~
369369

370-
.. Items can also be extracted by providing a Boolean mask. E.g.:
370+
Items can also be extracted by providing a Boolean mask. E.g.:
371371

372372
.. ipython:: python
373373

docs/user-guide/attributes.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.. _tutorial_attrs:
2+
3+
Working with attributes
4+
=======================
5+
6+
Zarr arrays and groups support custom key/value attributes, which can be useful for
7+
storing application-specific metadata. For example:
8+
9+
.. ipython:: python
10+
11+
root = zarr.group()
12+
13+
root.attrs['foo'] = 'bar'
14+
15+
z = root.zeros(name='zzz', shape=(10000, 10000))
16+
17+
z.attrs['baz'] = 42
18+
19+
z.attrs['qux'] = [1, 4, 7, 12]
20+
21+
sorted(root.attrs)
22+
23+
'foo' in root.attrs
24+
25+
root.attrs['foo']
26+
27+
sorted(z.attrs)
28+
29+
z.attrs['baz']
30+
31+
z.attrs['qux']
32+
33+
Internally Zarr uses JSON to store array attributes, so attribute values must be
34+
JSON serializable.

docs/user-guide/consolidated_metadata.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Consolidated Metadata
22
=====================
33

4-
Zarr-Python implements the `Consolidated Metadata_` extension to the Zarr Spec.
4+
Zarr-Python implements the `Consolidated Metadata`_ extension to the Zarr Spec.
55
Consolidated metadata can reduce the time needed to load the metadata for an
66
entire hierarchy, especially when the metadata is being served over a network.
77
Consolidated metadata essentially stores all the metadata for a hierarchy in the
@@ -13,7 +13,7 @@ Usage
1313
If consolidated metadata is present in a Zarr Group's metadata then it is used
1414
by default. The initial read to open the group will need to communicate with
1515
the store (reading from a file for a :class:`zarr.storage.LocalStore`, making a
16-
network request for a :class:`zarr.storage.RemoteStore`). After that, any subsequent
16+
network request for a :class:`zarr.storage.FsspecStore`). After that, any subsequent
1717
metadata reads get child Group or Array nodes will *not* require reads from the store.
1818

1919
In Python, the consolidated metadata is available on the ``.consolidated_metadata``
@@ -32,7 +32,7 @@ attribute of the ``GroupMetadata`` object.
3232
group.create_array(shape=(3, 3, 3), name="c")
3333
zarr.consolidate_metadata(store)
3434
35-
If we open that group, the Group's metadata has a :class:`zarr.ConsolidatedMetadata`
35+
If we open that group, the Group's metadata has a :class:`zarr.core.group.ConsolidatedMetadata`
3636
that can be used.
3737

3838
.. ipython:: python

docs/user-guide/groups.rst

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -119,38 +119,3 @@ Groups also have the :func:`zarr.Group.tree` method, e.g.:
119119

120120
:func:`zarr.Group.tree` requires the optional `rich <https://rich.readthedocs.io/en/stable/>`_
121121
dependency. It can be installed with the ``[tree]`` extra.
122-
123-
.. _tutorial_attrs:
124-
125-
User attributes
126-
---------------
127-
128-
Zarr arrays and groups support custom key/value attributes, which can be useful for
129-
storing application-specific metadata. For example:
130-
131-
.. ipython:: python
132-
133-
root = zarr.group()
134-
135-
root.attrs['foo'] = 'bar'
136-
137-
z = root.zeros(name='zzz', shape=(10000, 10000))
138-
139-
z.attrs['baz'] = 42
140-
141-
z.attrs['qux'] = [1, 4, 7, 12]
142-
143-
sorted(root.attrs)
144-
145-
'foo' in root.attrs
146-
147-
root.attrs['foo']
148-
149-
sorted(z.attrs)
150-
151-
z.attrs['baz']
152-
153-
z.attrs['qux']
154-
155-
Internally Zarr uses JSON to store array attributes, so attribute values must be
156-
JSON serializable.

docs/user-guide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ User Guide
99
installation
1010
arrays
1111
groups
12+
attributes
1213
storage
1314
config
1415
v3_migration

docs/user-guide/storage.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Storage
44
=======
55

66
Zarr-Python supports multiple storage backends, including: local file systems,
7-
Zip files, remote stores via ``fsspec`` (S3, HTTP, etc.), and in-memory stores. In
7+
Zip files, remote stores via fsspec_ (S3, HTTP, etc.), and in-memory stores. In
88
Zarr-Python 3, stores must implement the abstract store API from
99
:class:`zarr.abc.store.Store`.
1010

@@ -58,7 +58,7 @@ Zip Store
5858
~~~~~~~~~
5959

6060
The :class:`zarr.storage.ZipStore` stores the contents of a Zarr hierarchy in a single
61-
Zip file. The `Zip Store specification_` is currently in draft form.
61+
Zip file. The `Zip Store specification`_ is currently in draft form.
6262

6363
.. ipython:: python
6464
@@ -71,9 +71,9 @@ Remote Store
7171
The :class:`zarr.storage.FsspecStore` stores the contents of a Zarr hierarchy in following the same
7272
logical layout as the ``LocalStore``, except the store is assumed to be on a remote storage system
7373
such as cloud object storage (e.g. AWS S3, Google Cloud Storage, Azure Blob Store). The
74-
:class:`zarr.storage.FsspecStore` is backed by `Fsspec_` and can support any Fsspec backend
74+
:class:`zarr.storage.FsspecStore` is backed by `fsspec`_ and can support any backend
7575
that implements the `AbstractFileSystem` API. ``storage_options`` can be used to configure
76-
the Fsspec backend.
76+
the fsspec backend.
7777

7878
.. ipython:: python
7979
@@ -87,7 +87,7 @@ the Fsspec backend.
8787
Memory Store
8888
~~~~~~~~~~~~
8989

90-
The :class:`zarr.storage.FsspecStore` a in-memory store that allows for serialization of
90+
The :class:`zarr.storage.MemoryStore` a in-memory store that allows for serialization of
9191
Zarr data (metadata and chunks) to a dictionary.
9292

9393
.. ipython:: python
@@ -104,4 +104,4 @@ Class includes all of the methods needed to be a fully operational store in Zarr
104104
Zarr also provides a test harness for custom stores: :class:`zarr.testing.store.StoreTests`.
105105

106106
.. _Zip Store Specification: https://github.com/zarr-developers/zarr-specs/pull/311
107-
.. _Fsspec: https://zarr-specs.readthedocs.io/en/latest/v3/core/v3.0.html#consolidated-metadata
107+
.. _fsspec: https://filesystem-spec.readthedocs.io

docs/user-guide/v3_migration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ after the 3.0 release:
180180

181181
- The following options in the top-level API have not been ported to Zarr-Python 3 yet.
182182
If these options are important to you, please open a
183-
`GitHub issue <https://github.com/zarr-developers/zarr-python/issues/new>` describing
183+
`GitHub issue <https://github.com/zarr-developers/zarr-python/issues/new>`_ describing
184184
your use case.
185185

186186
* ``cache_attrs``

0 commit comments

Comments
 (0)