Skip to content

Commit d2bc7d6

Browse files
committed
Convert references and admonitions
1 parent ba782a8 commit d2bc7d6

File tree

14 files changed

+189
-180
lines changed

14 files changed

+189
-180
lines changed

src/zarr/api/asynchronous.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ async def save_group(
556556
async def tree(grp: AsyncGroup, expand: bool | None = None, level: int | None = None) -> Any:
557557
"""Provide a rich display of the hierarchy.
558558
559-
.. deprecated:: 3.0.0
560-
`zarr.tree()` is deprecated and will be removed in a future release.
559+
!!! warning "Deprecated"
560+
`zarr.tree()` is deprecated since v3.0.0 and will be removed in a future release.
561561
Use `group.tree()` instead.
562562
563563
Parameters

src/zarr/api/synchronous.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ def save_group(
352352
def tree(grp: Group, expand: bool | None = None, level: int | None = None) -> Any:
353353
"""Provide a rich display of the hierarchy.
354354
355-
.. deprecated:: 3.0.0
356-
`zarr.tree()` is deprecated and will be removed in a future release.
355+
!!! warning "Deprecated"
356+
`zarr.tree()` is deprecated since v3.0.0 and will be removed in a future release.
357357
Use `group.tree()` instead.
358358
359359
Parameters

src/zarr/codecs/numcodecs/_codecs.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
... compressors=[numcodecs.zarr3.BZ2(level=5)])
1616
>>> array[:] = np.arange(*array.shape).astype(array.dtype)
1717
18-
.. note::
19-
18+
!!! note
2019
Please note that the codecs in [zarr.codecs.numcodecs][] are not part of the Zarr version
2120
3 specification. Using these codecs might cause interoperability issues with other Zarr
2221
implementations.

src/zarr/core/array.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,9 @@ async def create(
492492
) -> AsyncArray[ArrayV2Metadata] | AsyncArray[ArrayV3Metadata]:
493493
"""Method to create a new asynchronous array instance.
494494
495-
.. deprecated:: 3.0.0
496-
Deprecated in favor of [`zarr.api.asynchronous.create_array`][].
495+
!!! warning "Deprecated"
496+
`AsyncArray.create()` is deprecated since v3.0.0 and will be removed in a future release.
497+
Use [`zarr.api.asynchronous.create_array`][] instead.
497498
498499
Parameters
499500
----------
@@ -1082,9 +1083,9 @@ def compressor(self) -> Numcodec | None:
10821083
"""
10831084
Compressor that is applied to each chunk of the array.
10841085
1085-
.. deprecated:: 3.0.0
1086-
`array.compressor` is deprecated and will be removed in a future release.
1087-
Use `array.compressors` instead.
1086+
!!! warning "Deprecated"
1087+
`Array.compressor` is deprecated since v3.0.0 and will be removed in a future release.
1088+
Use [`Array.compressors`][zarr.AsyncArray.compressors] instead.
10881089
"""
10891090
if self.metadata.zarr_format == 2:
10901091
return self.metadata.compressor
@@ -2035,8 +2036,9 @@ def create(
20352036
) -> Array:
20362037
"""Creates a new Array instance from an initialized store.
20372038
2038-
.. deprecated:: 3.0.0
2039-
Deprecated in favor of [`zarr.create_array`][].
2039+
!!! warning "Deprecated"
2040+
`Array.create()` is deprecated since v3.0.0 and will be removed in a future release.
2041+
Use [`zarr.create_array`][] instead.
20402042
20412043
Parameters
20422044
----------
@@ -2080,7 +2082,7 @@ def create(
20802082
order : Literal["C", "F"], optional
20812083
The memory of the array (default is "C").
20822084
If ``zarr_format`` is 2, this parameter sets the memory order of the array.
2083-
If `zarr_format`` is 3, then this parameter is deprecated, because memory order
2085+
If ``zarr_format`` is 3, then this parameter is deprecated, because memory order
20842086
is a runtime parameter for Zarr 3 arrays. The recommended way to specify the memory
20852087
order for Zarr 3 arrays is via the ``config`` parameter, e.g. ``{'order': 'C'}``.
20862088
filters : list[dict[str, JSON]], optional
@@ -2393,9 +2395,9 @@ def compressor(self) -> Numcodec | None:
23932395
"""
23942396
Compressor that is applied to each chunk of the array.
23952397
2396-
.. deprecated:: 3.0.0
2397-
`array.compressor` is deprecated and will be removed in a future release.
2398-
Use `array.compressors` instead.
2398+
!!! warning "Deprecated"
2399+
`array.compressor` is deprecated since v3.0.0 and will be removed in a future release.
2400+
Use [`array.compressors`][zarr.Array.compressors] instead.
23992401
"""
24002402
return self._async_array.compressor
24012403

src/zarr/core/attributes.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ def put(self, d: dict[str, JSON]) -> None:
4242
4343
Equivalent to the following pseudo-code, but performed atomically.
4444
45-
.. code-block:: python
46-
47-
>>> attrs = {"a": 1, "b": 2}
48-
>>> attrs.clear()
49-
>>> attrs.update({"a": 3", "c": 4})
50-
>>> attrs
51-
{'a': 3, 'c': 4}
45+
```python
46+
>>> attrs = {"a": 1, "b": 2}
47+
>>> attrs.clear()
48+
>>> attrs.update({"a": 3", "c": 4})
49+
>>> attrs
50+
{'a': 3, 'c': 4}
51+
```
5252
"""
5353
self._obj.metadata.attributes.clear()
5454
self._obj = self._obj.update_attributes(d)

src/zarr/core/config.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
to be ``your.module.NewBytesCodec``. Donfig can be configured programmatically, by environment variables, or from
99
YAML files in standard locations.
1010
11-
.. code-block:: python
11+
```python
12+
from your.module import NewBytesCodec
13+
from zarr.core.config import register_codec, config
1214
13-
from your.module import NewBytesCodec
14-
from zarr.core.config import register_codec, config
15-
16-
register_codec("bytes", NewBytesCodec)
17-
config.set({"codecs.bytes": "your.module.NewBytesCodec"})
15+
register_codec("bytes", NewBytesCodec)
16+
config.set({"codecs.bytes": "your.module.NewBytesCodec"})
17+
```
1818
1919
Instead of setting the value programmatically with ``config.set``, you can also set the value with an environment
2020
variable. The environment variable ``ZARR_CODECS__BYTES`` can be set to ``your.module.NewBytesCodec``. The double
2121
underscore ``__`` is used to indicate nested access.
2222
23-
.. code-block:: bash
24-
25-
export ZARR_CODECS__BYTES="your.module.NewBytesCodec"
23+
```bash
24+
export ZARR_CODECS__BYTES="your.module.NewBytesCodec"
25+
```
2626
2727
For more information, see the Donfig documentation at https://github.com/pytroll/donfig.
2828
"""

src/zarr/core/dtype/npy/bool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Bool(ZDType[np.dtypes.BoolDType, np.bool_], HasItemSize):
4141
----------
4242
This class implements the boolean data type defined in Zarr V2 and V3.
4343
44-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
44+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding)and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
4545
"""
4646

4747
_zarr_v3_name: ClassVar[Literal["bool"]] = "bool"

src/zarr/core/dtype/npy/bytes.py

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class FixedLengthBytesConfig(TypedDict):
3636
3737
Examples
3838
--------
39-
.. code-block:: python
40-
41-
{
42-
"length_bytes": 12
43-
}
39+
```python
40+
{
41+
"length_bytes": 12
42+
}
43+
```
4444
"""
4545

4646
length_bytes: int
@@ -56,17 +56,17 @@ class NullterminatedBytesJSON_V2(DTypeConfig_V2[str, None]):
5656
References
5757
----------
5858
The structure of the ``name`` field is defined in the Zarr V2
59-
`specification document <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__.
59+
[specification document](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding).
6060
6161
6262
Examples
6363
--------
64-
.. code-block:: python
65-
66-
{
67-
"name": "|S10",
68-
"object_codec_id": None
69-
}
64+
```python
65+
{
66+
"name": "|S10",
67+
"object_codec_id": None
68+
}
69+
```
7070
"""
7171

7272

@@ -83,14 +83,14 @@ class NullTerminatedBytesJSON_V3(
8383
8484
Examples
8585
--------
86-
.. code-block:: python
87-
88-
{
89-
"name": "null_terminated_bytes",
90-
"configuration": {
91-
"length_bytes": 12
92-
}
86+
```python
87+
{
88+
"name": "null_terminated_bytes",
89+
"configuration": {
90+
"length_bytes": 12
9391
}
92+
}
93+
```
9494
9595
"""
9696

@@ -105,17 +105,18 @@ class RawBytesJSON_V2(DTypeConfig_V2[str, None]):
105105
References
106106
----------
107107
The structure of the ``name`` field is defined in the Zarr V2
108-
`specification document <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__.
108+
[specification document](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding).
109109
110110
111111
Examples
112112
--------
113-
.. code-block:: python
113+
```python
114114
115115
{
116116
"name": "|V10",
117117
"object_codec_id": None
118118
}
119+
```
119120
"""
120121

121122

@@ -130,12 +131,14 @@ class RawBytesJSON_V3(NamedConfig[Literal["raw_bytes"], FixedLengthBytesConfig])
130131
131132
Examples
132133
--------
133-
.. code-block:: python
134-
135-
{
136-
"name": "raw_bytes",
137-
"configuration": {
138-
"length_bytes": 12
134+
```python
135+
{
136+
"name": "raw_bytes",
137+
"configuration": {
138+
"length_bytes": 12
139+
}
140+
}
141+
```
139142
"""
140143

141144

@@ -149,16 +152,16 @@ class VariableLengthBytesJSON_V2(DTypeConfig_V2[Literal["|O"], Literal["vlen-byt
149152
References
150153
----------
151154
The structure of the ``name`` field is defined in the Zarr V2
152-
`specification document <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__.
155+
[specification document](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding).
153156
154157
Examples
155158
--------
156-
.. code-block:: python
157-
158-
{
159-
"name": "|O",
160-
"object_codec_id": "vlen-bytes"
161-
}
159+
```python
160+
{
161+
"name": "|O",
162+
"object_codec_id": "vlen-bytes"
163+
}
164+
```
162165
"""
163166

164167

src/zarr/core/dtype/npy/float.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class Float16(BaseFloat[np.dtypes.Float16DType, np.float16]):
326326
----------
327327
This class implements the float16 data type defined in Zarr V2 and V3.
328328
329-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
329+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
330330
"""
331331

332332
dtype_cls = np.dtypes.Float16DType
@@ -363,7 +363,7 @@ class Float32(BaseFloat[np.dtypes.Float32DType, np.float32]):
363363
----------
364364
This class implements the float32 data type defined in Zarr V2 and V3.
365365
366-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
366+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
367367
"""
368368

369369
dtype_cls = np.dtypes.Float32DType
@@ -400,7 +400,7 @@ class Float64(BaseFloat[np.dtypes.Float64DType, np.float64]):
400400
----------
401401
This class implements the float64 data type defined in Zarr V2 and V3.
402402
403-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
403+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
404404
"""
405405

406406
dtype_cls = np.dtypes.Float64DType

src/zarr/core/dtype/npy/int.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class Int8(BaseInt[np.dtypes.Int8DType, np.int8]):
248248
----------
249249
This class implements the 8-bit signed integer data type defined in Zarr V2 and V3.
250250
251-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
251+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
252252
"""
253253

254254
dtype_cls = np.dtypes.Int8DType
@@ -404,7 +404,7 @@ class UInt8(BaseInt[np.dtypes.UInt8DType, np.uint8]):
404404
----------
405405
This class implements the 8-bit unsigned integer data type defined in Zarr V2 and V3.
406406
407-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
407+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
408408
"""
409409

410410
dtype_cls = np.dtypes.UInt8DType
@@ -551,7 +551,7 @@ class Int16(BaseInt[np.dtypes.Int16DType, np.int16], HasEndianness):
551551
----------
552552
This class implements the 16-bit signed integer data type defined in Zarr V2 and V3.
553553
554-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
554+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
555555
"""
556556

557557
dtype_cls = np.dtypes.Int16DType
@@ -713,7 +713,7 @@ class UInt16(BaseInt[np.dtypes.UInt16DType, np.uint16], HasEndianness):
713713
----------
714714
This class implements the unsigned 16-bit unsigned integer data type defined in Zarr V2 and V3.
715715
716-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
716+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
717717
"""
718718

719719
dtype_cls = np.dtypes.UInt16DType
@@ -875,7 +875,7 @@ class Int32(BaseInt[np.dtypes.Int32DType, np.int32], HasEndianness):
875875
----------
876876
This class implements the 32-bit signed integer data type defined in Zarr V2 and V3.
877877
878-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
878+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
879879
"""
880880

881881
dtype_cls = np.dtypes.Int32DType
@@ -1058,7 +1058,7 @@ class UInt32(BaseInt[np.dtypes.UInt32DType, np.uint32], HasEndianness):
10581058
----------
10591059
This class implements the 32-bit unsigned integer data type defined in Zarr V2 and V3.
10601060
1061-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
1061+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
10621062
"""
10631063

10641064
dtype_cls = np.dtypes.UInt32DType
@@ -1216,7 +1216,7 @@ class Int64(BaseInt[np.dtypes.Int64DType, np.int64], HasEndianness):
12161216
----------
12171217
This class implements the 64-bit signed integer data type defined in Zarr V2 and V3.
12181218
1219-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
1219+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
12201220
"""
12211221

12221222
dtype_cls = np.dtypes.Int64DType
@@ -1374,7 +1374,7 @@ class UInt64(BaseInt[np.dtypes.UInt64DType, np.uint64], HasEndianness):
13741374
----------
13751375
This class implements the unsigned 64-bit integer data type defined in Zarr V2 and V3.
13761376
1377-
See the `Zarr V2 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding>`__ and `Zarr V3 <https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst>`__ specification documents for details.
1377+
See the [Zarr V2](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v2/v2.0.rst#data-type-encoding) and [Zarr V3](https://github.com/zarr-developers/zarr-specs/blob/main/docs/v3/data-types/index.rst) specification documents for details.
13781378
"""
13791379

13801380
dtype_cls = np.dtypes.UInt64DType

0 commit comments

Comments
 (0)