Skip to content

Commit cee23aa

Browse files
committed
escape piped return types
1 parent 6e6d337 commit cee23aa

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ class Bool(ZDType[np.dtypes.BoolDType, np.bool_], HasItemSize):
2828
2929
Attributes
3030
----------
31+
3132
_zarr_v3_name : Literal["bool"] = "bool"
3233
The Zarr v3 name of the dtype.
33-
_zarr_v2_name : Literal["|b1"] = "|b1"
34+
_zarr_v2_name : ``Literal["|b1"]`` = ``"|b1"``
3435
The Zarr v2 name of the dtype, which is also a string representation
3536
of the boolean dtype used by NumPy.
3637
dtype_cls : ClassVar[type[np.dtypes.BoolDType]] = np.dtypes.BoolDType
@@ -99,7 +100,7 @@ def _check_json_v2(
99100
100101
Returns
101102
-------
102-
TypeGuard[DTypeConfig_V2[Literal["|b1"], None]]
103+
``TypeGuard[DTypeConfig_V2[Literal["|b1"], None]]``
103104
True if the input is a valid JSON representation, False otherwise.
104105
"""
105106
return (
@@ -194,7 +195,7 @@ def to_json(
194195
195196
Returns
196197
-------
197-
DTypeConfig_V2[Literal["|b1"], None] or Literal["bool"]
198+
``DTypeConfig_V2[Literal["|b1"], None] | Literal["bool"]``
198199
The JSON representation of the Bool instance.
199200
200201
Raises

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ def to_json(
990990
991991
Returns
992992
-------
993-
DTypeConfig_V2[Literal["|O"], Literal["vlen-bytes"]] | Literal["variable_length_bytes"]
993+
``DTypeConfig_V2[Literal["|O"], Literal["vlen-bytes"]] | Literal["variable_length_bytes"]``
994994
The JSON-serializable representation of the variable-length bytes data type.
995995
For zarr_format 2, returns a dictionary with "name" and "object_codec_id".
996996
For zarr_format 3, returns a string identifier "variable_length_bytes".

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class Int8(BaseInt[np.dtypes.Int8DType, np.int8]):
248248
The class of the underlying NumPy dtype.
249249
_zarr_v3_name : ClassVar[Literal["int8"]] = "int8"
250250
The name of this data type in Zarr V3.
251-
_zarr_v2_names : ClassVar[tuple[Literal["|i1"]]] = ("|i1",)
251+
_zarr_v2_names : ``ClassVar[tuple[Literal["|i1"]]]`` = ``("|i1",)``
252252
The names of this data type in Zarr V2.
253253
"""
254254

@@ -362,7 +362,7 @@ def to_json(
362362
363363
Returns
364364
-------
365-
DTypeConfig_V2[Literal["|i1"], None] | Literal["int8"]
365+
``DTypeConfig_V2[Literal["|i1"], None] | Literal["int8"]``
366366
The JSON-serializable representation of the data type.
367367
368368
Raises
@@ -402,7 +402,7 @@ class UInt8(BaseInt[np.dtypes.UInt8DType, np.uint8]):
402402
The class of the underlying NumPy dtype.
403403
_zarr_v3_name : ClassVar[Literal["uint8"]] = "uint8"
404404
The name of this data type in Zarr V3.
405-
_zarr_v2_names : ClassVar[tuple[Literal["|u1"]]] = ("|u1",)
405+
_zarr_v2_names : ``ClassVar[tuple[Literal["|u1"]]]`` = ``("|u1",)``
406406
The names of this data type in Zarr V2.
407407
"""
408408

@@ -503,7 +503,7 @@ def to_json(
503503
504504
Returns
505505
-------
506-
DTypeConfig_V2[Literal["|u1"], None] | Literal["uint8"]
506+
``DTypeConfig_V2[Literal["|u1"], None] | Literal["uint8"]``
507507
The JSON-serializable representation of the data type.
508508
509509
Raises

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def _check_json_v2(
432432
433433
Returns
434434
-------
435-
TypeGuard[DTypeConfig_V2[Literal["|O"], Literal["vlen-utf8"]]]
435+
``TypeGuard[DTypeConfig_V2[Literal["|O"], Literal["vlen-utf8"]]]``
436436
Whether the input is a valid JSON representation of a NumPy "object" data type, and that the
437437
object codec id is appropriate for variable-length UTF-8 strings.
438438
"""
@@ -524,7 +524,7 @@ def to_json(
524524
525525
Returns
526526
-------
527-
DTypeConfig_V2[Literal["|O"], Literal["vlen-utf8"]] | Literal["variable_length_utf8"]
527+
``DTypeConfig_V2[Literal["|O"], Literal["vlen-utf8"]] | Literal["variable_length_utf8"]``
528528
The JSON representation of this data type.
529529
"""
530530
if zarr_format == 2:

0 commit comments

Comments
 (0)