Skip to content

Commit defe9c2

Browse files
committed
Improve numpy dtype cross-references
1 parent d2bc7d6 commit defe9c2

File tree

5 files changed

+39
-39
lines changed

5 files changed

+39
-39
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class Bool(ZDType[np.dtypes.BoolDType, np.bool_], HasItemSize):
2323
"""
2424
A Zarr data type for arrays containing booleans.
2525
26-
Wraps the ``np.dtypes.BoolDType`` data type. Scalars for this data type are instances of
27-
``np.bool_``.
26+
Wraps the [`np.dtypes.BoolDType`][numpy.dtypes.BoolDType] data type. Scalars for this data type are instances of
27+
[`np.bool_`][numpy.bool_].
2828
2929
Attributes
3030
----------
@@ -236,7 +236,7 @@ def cast_scalar(self, data: object) -> np.bool_:
236236
237237
Returns
238238
-------
239-
``np.bool_``
239+
bool : np.bool_
240240
The numpy boolean scalar.
241241
242242
Raises
@@ -258,7 +258,7 @@ def default_scalar(self) -> np.bool_:
258258
259259
Returns
260260
-------
261-
``np.bool_``
261+
bool : np.bool_
262262
The default value.
263263
"""
264264
return np.False_
@@ -294,7 +294,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.bool_:
294294
295295
Returns
296296
-------
297-
``np.bool_``
297+
bool : np.bool_
298298
The numpy boolean scalar.
299299
300300
Raises

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ class NullTerminatedBytes(ZDType[np.dtypes.BytesDType[int], np.bytes_], HasLengt
170170
"""
171171
A Zarr data type for arrays containing fixed-length null-terminated byte sequences.
172172
173-
Wraps the ``np.dtypes.BytesDType`` data type. Scalars for this data type are instances of
174-
``np.bytes_``.
173+
Wraps the [`np.dtypes.BytesDType`][numpy.dtypes.BytesDType] data type. Scalars for this data type are instances of
174+
[`np.bytes_`][numpy.bytes_].
175175
176176
This data type is parametrized by an integral length which specifies size in bytes of each
177177
scalar. Because this data type uses null-terminated semantics, indexing into
@@ -413,7 +413,7 @@ def _check_scalar(self, data: object) -> TypeGuard[BytesLike]:
413413

414414
def _cast_scalar_unchecked(self, data: BytesLike) -> np.bytes_:
415415
"""
416-
Cast the provided scalar data to ``np.bytes_``, truncating if necessary.
416+
Cast the provided scalar data to [`np.bytes_`][numpy.bytes_], truncating if necessary.
417417
418418
Parameters
419419
----------
@@ -422,7 +422,7 @@ def _cast_scalar_unchecked(self, data: BytesLike) -> np.bytes_:
422422
423423
Returns
424424
-------
425-
np.bytes_
425+
bytes : [`np.bytes_`][numpy.bytes_]
426426
The casted data as a NumPy bytes scalar.
427427
428428
Notes
@@ -450,7 +450,7 @@ def cast_scalar(self, data: object) -> np.bytes_:
450450
451451
Returns
452452
-------
453-
``np.bytes_``
453+
bytes : [`np.bytes_`][numpy.bytes_]
454454
The data cast as a NumPy bytes scalar.
455455
456456
Raises
@@ -473,7 +473,7 @@ def default_scalar(self) -> np.bytes_:
473473
474474
Returns
475475
-------
476-
``np.bytes_``
476+
bytes : [`np.bytes_`][numpy.bytes_]
477477
The default scalar value.
478478
"""
479479
return np.bytes_(b"")
@@ -502,7 +502,7 @@ def to_json_scalar(self, data: object, *, zarr_format: ZarrFormat) -> str:
502502

503503
def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.bytes_:
504504
"""
505-
Read a JSON-serializable value as ``np.bytes_``.
505+
Read a JSON-serializable value as [`np.bytes_`][numpy.bytes_].
506506
507507
Parameters
508508
----------
@@ -513,7 +513,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.bytes_:
513513
514514
Returns
515515
-------
516-
``np.bytes_``
516+
bytes : [`np.bytes_`][numpy.bytes_]
517517
The NumPy bytes scalar obtained from decoding the base64 string.
518518
519519
Raises
@@ -546,7 +546,7 @@ class RawBytes(ZDType[np.dtypes.VoidDType[int], np.void], HasLength, HasItemSize
546546
"""
547547
A Zarr data type for arrays containing fixed-length sequences of raw bytes.
548548
549-
Wraps the NumPy ``void`` data type. Scalars for this data type are instances of ``np.void``.
549+
Wraps the NumPy ``void`` data type. Scalars for this data type are instances of [`np.void`][numpy.void].
550550
551551
This data type is parametrized by an integral length which specifies size in bytes of each
552552
scalar belonging to this data type.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@ class Complex64(BaseComplex[np.dtypes.Complex64DType, np.complex64]):
353353
"""
354354
A Zarr data type for arrays containing 64 bit complex floats.
355355
356-
Wraps the ``np.dtypes.Complex64DType`` data type. Scalars for this data type
357-
are instances of ``np.complex64``.
356+
Wraps the [`np.dtypes.Complex64DType`][numpy.dtypes.Complex64DType] data type. Scalars for this data type
357+
are instances of [`np.complex64`][numpy.complex64].
358358
359359
Attributes
360360
----------
@@ -388,8 +388,8 @@ class Complex128(BaseComplex[np.dtypes.Complex128DType, np.complex128], HasEndia
388388
"""
389389
A Zarr data type for arrays containing 64 bit complex floats.
390390
391-
Wraps the ``np.dtypes.Complex128DType`` data type. Scalars for this data type
392-
are instances of ``np.complex128``.
391+
Wraps the [`np.dtypes.Complex128DType`][numpy.dtypes.Complex128DType] data type. Scalars for this data type
392+
are instances of [`np.complex128`][numpy.complex128].
393393
394394
Attributes
395395
----------

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ class Float16(BaseFloat[np.dtypes.Float16DType, np.float16]):
314314
"""
315315
A Zarr data type for arrays containing 16-bit floating point numbers.
316316
317-
Wraps the ``np.dtypes.Float16DType`` data type. Scalars for this data type are instances
318-
of ``np.float16``.
317+
Wraps the [`np.dtypes.Float16DType`][numpy.dtypes.Float16DType] data type. Scalars for this data type are instances
318+
of [`np.float16`][numpy.float16].
319319
320320
Attributes
321321
----------
@@ -351,8 +351,8 @@ class Float32(BaseFloat[np.dtypes.Float32DType, np.float32]):
351351
"""
352352
A Zarr data type for arrays containing 32-bit floating point numbers.
353353
354-
Wraps the ``np.dtypes.Float32DType`` data type. Scalars for this data type are instances
355-
of ``np.float32``.
354+
Wraps the [`np.dtypes.Float32DType`][numpy.dtypes.Float32DType] data type. Scalars for this data type are instances
355+
of [`np.float32`][numpy.float32].
356356
357357
Attributes
358358
----------
@@ -388,8 +388,8 @@ class Float64(BaseFloat[np.dtypes.Float64DType, np.float64]):
388388
"""
389389
A Zarr data type for arrays containing 64-bit floating point numbers.
390390
391-
Wraps the ``np.dtypes.Float64DType`` data type. Scalars for this data type are instances
392-
of ``np.float64``.
391+
Wraps the [`np.dtypes.Float64DType`][numpy.dtypes.Float64DType] data type. Scalars for this data type are instances
392+
of [`np.float64`][numpy.float64].
393393
394394
Attributes
395395
----------

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ class Int8(BaseInt[np.dtypes.Int8DType, np.int8]):
236236
"""
237237
A Zarr data type for arrays containing 8-bit signed integers.
238238
239-
Wraps the ``np.dtypes.Int8DType`` data type. Scalars for this data type are
240-
instances of ``np.int8``.
239+
Wraps the [`np.dtypes.Int8DType`][numpy.dtypes.Int8DType] data type. Scalars for this data type are
240+
instances of [`np.int8`][numpy.int8].
241241
242242
Attributes
243243
----------
@@ -393,7 +393,7 @@ class UInt8(BaseInt[np.dtypes.UInt8DType, np.uint8]):
393393
"""
394394
A Zarr data type for arrays containing 8-bit unsigned integers.
395395
396-
Wraps the ``np.dtypes.UInt8DType`` data type. Scalars for this data type are instances of ``np.uint8``.
396+
Wraps the [`np.dtypes.UInt8DType`][numpy.dtypes.UInt8DType] data type. Scalars for this data type are instances of [`np.uint8`][numpy.uint8].
397397
398398
Attributes
399399
----------
@@ -539,8 +539,8 @@ class Int16(BaseInt[np.dtypes.Int16DType, np.int16], HasEndianness):
539539
"""
540540
A Zarr data type for arrays containing 16-bit signed integers.
541541
542-
Wraps the ``np.dtypes.Int16DType`` data type. Scalars for this data type are instances of
543-
``np.int16``.
542+
Wraps the [`np.dtypes.Int16DType`][numpy.dtypes.Int16DType] data type. Scalars for this data type are instances of
543+
[`np.int16`][numpy.int16].
544544
545545
Attributes
546546
----------
@@ -701,8 +701,8 @@ class UInt16(BaseInt[np.dtypes.UInt16DType, np.uint16], HasEndianness):
701701
"""
702702
A Zarr data type for arrays containing 16-bit unsigned integers.
703703
704-
Wraps the ``np.dtypes.UInt16DType`` data type. Scalars for this data type are instances of
705-
``np.uint16``.
704+
Wraps the [`np.dtypes.UInt16DType`][numpy.dtypes.UInt16DType] data type. Scalars for this data type are instances of
705+
[`np.uint16`][numpy.uint16].
706706
707707
Attributes
708708
----------
@@ -863,8 +863,8 @@ class Int32(BaseInt[np.dtypes.Int32DType, np.int32], HasEndianness):
863863
"""
864864
A Zarr data type for arrays containing 32-bit signed integers.
865865
866-
Wraps the ``np.dtypes.Int32DType`` data type. Scalars for this data type are instances of
867-
``np.int32``.
866+
Wraps the [`np.dtypes.Int32DType`][numpy.dtypes.Int32DType] data type. Scalars for this data type are instances of
867+
[`np.int32`][numpy.int32].
868868
869869
Attributes
870870
----------
@@ -1046,8 +1046,8 @@ class UInt32(BaseInt[np.dtypes.UInt32DType, np.uint32], HasEndianness):
10461046
"""
10471047
A Zarr data type for arrays containing 32-bit unsigned integers.
10481048
1049-
Wraps the ``np.dtypes.UInt32DType`` data type. Scalars for this data type are instances of
1050-
``np.uint32``.
1049+
Wraps the [`np.dtypes.UInt32DType`][numpy.dtypes.UInt32DType] data type. Scalars for this data type are instances of
1050+
[`np.uint32`][numpy.uint32].
10511051
10521052
Attributes
10531053
----------
@@ -1204,8 +1204,8 @@ class Int64(BaseInt[np.dtypes.Int64DType, np.int64], HasEndianness):
12041204
"""
12051205
A Zarr data type for arrays containing 64-bit signed integers.
12061206
1207-
Wraps the ``np.dtypes.Int64DType`` data type. Scalars for this data type are instances of
1208-
``np.int64``.
1207+
Wraps the [`np.dtypes.Int64DType`][numpy.dtypes.Int64DType] data type. Scalars for this data type are instances of
1208+
[`np.int64`][numpy.int64].
12091209
12101210
Attributes
12111211
----------
@@ -1362,8 +1362,8 @@ class UInt64(BaseInt[np.dtypes.UInt64DType, np.uint64], HasEndianness):
13621362
"""
13631363
A Zarr data type for arrays containing 64-bit unsigned integers.
13641364
1365-
Wraps the ``np.dtypes.UInt64DType`` data type. Scalars for this data type
1366-
are instances of ``np.uint64``.
1365+
Wraps the [`np.dtypes.UInt64DType`][numpy.dtypes.UInt64DType] data type. Scalars for this data type
1366+
are instances of [`np.uint64`][numpy.uint64].
13671367
13681368
Attributes
13691369
----------

0 commit comments

Comments
 (0)