Skip to content

Commit 89064f0

Browse files
committed
np -> numpy
1 parent 45aab29 commit 89064f0

File tree

9 files changed

+69
-69
lines changed

9 files changed

+69
-69
lines changed

docs/user-guide/data_types.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ We do this with an abstract Zarr data type class: `ZDType <../api/zarr/dtype/ind
179179
which provides Zarr V2 and Zarr V3 compatibility routines for "native" data types.
180180

181181
In this context, a "native" data type is a Python class, typically defined in another library, that
182-
models an array's data type. For example, ``np.dtypes.UInt8DType`` is a native data type defined in NumPy.
182+
models an array's data type. For example, ``numpy.dtypes.UInt8DType`` is a native data type defined in NumPy.
183183
Zarr Python wraps the NumPy ``uint8`` with a ``ZDType`` instance called
184184
`UInt8 <../api/zarr/dtype/index.html#zarr.dtype.ZDType>`_.
185185

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 NumPy ``np.dtypes.BoolDType`` data type. Scalars for this data type are instances of
27-
``np.bool_``.
26+
Wraps the ``numpy.dtypes.BoolDType`` data type. Scalars for this data type are instances of
27+
``numpy.bool_``.
2828
2929
Attributes
3030
----------
@@ -235,7 +235,7 @@ def cast_scalar(self, data: object) -> np.bool_:
235235
236236
Returns
237237
-------
238-
np.bool_
238+
numpy.bool_
239239
The numpy boolean scalar.
240240
241241
Raises
@@ -254,7 +254,7 @@ def default_scalar(self) -> np.bool_:
254254
255255
Returns
256256
-------
257-
np.bool_
257+
numpy.bool_
258258
The default value.
259259
"""
260260
return np.False_
@@ -290,7 +290,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.bool_:
290290
291291
Returns
292292
-------
293-
np.bool_
293+
numpy.bool_
294294
The numpy boolean scalar.
295295
296296
Raises

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class NullTerminatedBytes(ZDType[np.dtypes.BytesDType[int], np.bytes_], HasLengt
3737
"""
3838
A Zarr data type for arrays containing fixed-length null-terminated byte sequences.
3939
40-
Wraps the NumPy ``np.dtypes.BytesDType`` data type. Scalars for this data type are instances of
41-
``np.bytes_``.
40+
Wraps the ``numpy.dtypes.BytesDType`` data type. Scalars for this data type are instances of
41+
``numpy.bytes_``.
4242
4343
This data type is parametrized by an integral length which specifies size in bytes of each
4444
scalar. Because this data type uses null-terminated semantics, indexing into
@@ -60,16 +60,16 @@ class NullTerminatedBytes(ZDType[np.dtypes.BytesDType[int], np.bytes_], HasLengt
6060
from_json(data, zarr_format) : NullTerminatedBytes
6161
Create NullTerminatedBytes from JSON data.
6262
63-
cast_scalar(data) : np.bytes_
63+
cast_scalar(data) : numpy.bytes_
6464
Cast a python object to np.bytes_.
6565
66-
default_scalar() : np.bytes_
66+
default_scalar() : numpy.bytes_
6767
Return the default scalar value.
6868
6969
to_json_scalar(data, zarr_format) : str
7070
Convert input to a scalar and return as JSON data.
7171
72-
from_json_scalar(data, zarr_format) : np.bytes_
72+
from_json_scalar(data, zarr_format) : numpy.bytes_
7373
Create np.bytes_ from JSON data.
7474
7575
item_size : int
@@ -294,7 +294,7 @@ def _check_scalar(self, data: object) -> TypeGuard[BytesLike]:
294294

295295
def _cast_scalar_unchecked(self, data: BytesLike) -> np.bytes_:
296296
"""
297-
Cast the provided scalar data to ``np.bytes_``, truncating if necessary.
297+
Cast the provided scalar data to ``numpy.bytes_``, truncating if necessary.
298298
299299
Parameters
300300
----------
@@ -303,7 +303,7 @@ def _cast_scalar_unchecked(self, data: BytesLike) -> np.bytes_:
303303
304304
Returns
305305
-------
306-
np.bytes_
306+
numpy.bytes_
307307
The casted data as a NumPy bytes scalar.
308308
309309
Notes
@@ -331,7 +331,7 @@ def cast_scalar(self, data: object) -> np.bytes_:
331331
332332
Returns
333333
-------
334-
np.bytes_
334+
numpy.bytes_
335335
The data cast as a NumPy bytes scalar.
336336
337337
Raises
@@ -351,7 +351,7 @@ def default_scalar(self) -> np.bytes_:
351351
352352
Returns
353353
-------
354-
np.bytes_
354+
numpy.bytes_
355355
The default scalar value.
356356
"""
357357
return np.bytes_(b"")
@@ -391,7 +391,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.bytes_:
391391
392392
Returns
393393
-------
394-
np.bytes_
394+
numpy.bytes_
395395
The NumPy bytes scalar obtained from decoding the base64 string.
396396
397397
Raises
@@ -424,7 +424,7 @@ class RawBytes(ZDType[np.dtypes.VoidDType[int], np.void], HasLength, HasItemSize
424424
"""
425425
A Zarr data type for arrays containing fixed-length sequences of raw bytes.
426426
427-
Wraps the NumPy ``void`` data type. Scalars for this data type are instances of ``np.void``.
427+
Wraps the NumPy ``void`` data type. Scalars for this data type are instances of ``numpy.void``.
428428
429429
This data type is parametrized by an integral length which specifies size in bytes of each
430430
scalar belonging to this data type.
@@ -454,7 +454,7 @@ class RawBytes(ZDType[np.dtypes.VoidDType[int], np.void], HasLength, HasItemSize
454454
to_json_scalar(data, zarr_format) : str
455455
Convert input to a scalar and return as JSON data.
456456
457-
from_json_scalar(data, zarr_format) : np.bytes_
457+
from_json_scalar(data, zarr_format) : numpy.bytes_
458458
Create a np.void from JSON data.
459459
460460
item_size : int
@@ -724,7 +724,7 @@ def _cast_scalar_unchecked(self, data: object) -> np.void:
724724
725725
Returns
726726
-------
727-
np.void
727+
numpy.void
728728
The casted data as a NumPy void scalar.
729729
730730
Notes
@@ -753,7 +753,7 @@ def cast_scalar(self, data: object) -> np.void:
753753
754754
Returns
755755
-------
756-
np.void
756+
numpy.void
757757
The data cast as a NumPy void scalar.
758758
759759
Raises
@@ -775,7 +775,7 @@ def default_scalar(self) -> np.void:
775775
776776
Returns
777777
-------
778-
np.void
778+
numpy.void
779779
The default scalar value.
780780
"""
781781
return self.to_native_dtype().type(("\x00" * self.length).encode("ascii"))
@@ -815,7 +815,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.void:
815815
816816
Returns
817817
-------
818-
np.void
818+
numpy.void
819819
The NumPy void scalar.
820820
821821
Raises

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ class Complex64(BaseComplex[np.dtypes.Complex64DType, np.complex64]):
349349
"""
350350
A Zarr data type for arrays containing 64 bit complex floats.
351351
352-
Wraps the NumPy ``np.dtypes.Complex64DType`` data type. Scalars for this data type
353-
are instances of ``np.complex64``.
352+
Wraps the ``numpy.dtypes.Complex64DType`` data type. Scalars for this data type
353+
are instances of ``numpy.complex64``.
354354
355355
Attributes
356356
----------
@@ -384,8 +384,8 @@ class Complex128(BaseComplex[np.dtypes.Complex128DType, np.complex128], HasEndia
384384
"""
385385
A Zarr data type for arrays containing 64 bit complex floats.
386386
387-
Wraps the NumPy ``np.dtypes.Complex128DType`` data type. Scalars for this data type
388-
are instances of ``np.complex128``.
387+
Wraps the ``numpy.dtypes.Complex128DType`` data type. Scalars for this data type
388+
are instances of ``numpy.complex128``.
389389
390390
Attributes
391391
----------

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ class Float16(BaseFloat[np.dtypes.Float16DType, np.float16]):
317317
"""
318318
A Zarr data type for arrays containing 16-bit floating point numbers.
319319
320-
Wraps the NumPy ``np.dtypes.Float16DType`` data type. Scalars for this data type are instances
321-
of ``np.float16``.
320+
Wraps the ``numpy.dtypes.Float16DType`` data type. Scalars for this data type are instances
321+
of ``numpy.float16``.
322322
323323
Attributes
324324
----------
@@ -352,8 +352,8 @@ class Float32(BaseFloat[np.dtypes.Float32DType, np.float32]):
352352
"""
353353
A Zarr data type for arrays containing 32-bit floating point numbers.
354354
355-
Wraps the NumPy ``np.dtypes.Float32DType`` data type. Scalars for this data type are instances
356-
of ``np.float32``.
355+
Wraps the ``numpy.dtypes.Float32DType`` data type. Scalars for this data type are instances
356+
of ``numpy.float32``.
357357
358358
Attributes
359359
----------
@@ -387,8 +387,8 @@ class Float64(BaseFloat[np.dtypes.Float64DType, np.float64]):
387387
"""
388388
A Zarr data type for arrays containing 64-bit floating point numbers.
389389
390-
Wraps the NumPy ``np.dtypes.Float64DType`` data type. Scalars for this data type are instances
391-
of ``np.float64``.
390+
Wraps the ``numpy.dtypes.Float64DType`` data type. Scalars for this data type are instances
391+
of ``numpy.float64``.
392392
393393
Attributes
394394
----------

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ class Int8(BaseInt[np.dtypes.Int8DType, np.int8]):
258258
"""
259259
A Zarr data type for arrays containing 8-bit signed integers.
260260
261-
Wraps the NumPy ``np.dtypes.Int8DType`` data type. Scalars for this data type are
262-
instances of ``np.int8``.
261+
Wraps the ``numpy.dtypes.Int8DType`` data type. Scalars for this data type are
262+
instances of ``numpy.int8``.
263263
264264
Attributes
265265
----------
@@ -413,7 +413,7 @@ class UInt8(BaseInt[np.dtypes.UInt8DType, np.uint8]):
413413
"""
414414
A Zarr data type for arrays containing 8-bit unsigned integers.
415415
416-
Wraps the NumPy ``np.dtypes.UInt8DType`` data type. Scalars for this data type are instances of ``np.uint8``.
416+
Wraps the ``numpy.dtypes.UInt8DType`` data type. Scalars for this data type are instances of ``numpy.uint8``.
417417
418418
Attributes
419419
----------
@@ -557,8 +557,8 @@ class Int16(BaseInt[np.dtypes.Int16DType, np.int16], HasEndianness):
557557
"""
558558
A Zarr data type for arrays containing 16-bit signed integers.
559559
560-
Wraps the NumPy ``np.dtypes.Int16DType`` data type. Scalars for this data type are instances of
561-
``np.int16``.
560+
Wraps the ``numpy.dtypes.Int16DType`` data type. Scalars for this data type are instances of
561+
``numpy.int16``.
562562
563563
Attributes
564564
----------
@@ -717,8 +717,8 @@ class UInt16(BaseInt[np.dtypes.UInt16DType, np.uint16], HasEndianness):
717717
"""
718718
A Zarr data type for arrays containing 16-bit unsigned integers.
719719
720-
Wraps the NumPy ``np.dtypes.UInt16DType`` data type. Scalars for this data type are instances of
721-
``np.uint16``.
720+
Wraps the ``numpy.dtypes.UInt16DType`` data type. Scalars for this data type are instances of
721+
``numpy.uint16``.
722722
723723
Attributes
724724
----------
@@ -877,8 +877,8 @@ class Int32(BaseInt[np.dtypes.Int32DType, np.int32], HasEndianness):
877877
"""
878878
A Zarr data type for arrays containing 32-bit signed integers.
879879
880-
Wraps the NumPy ``np.dtypes.Int32DType`` data type. Scalars for this data type are instances of
881-
``np.int32``.
880+
Wraps the ``numpy.dtypes.Int32DType`` data type. Scalars for this data type are instances of
881+
``numpy.int32``.
882882
883883
Attributes
884884
----------
@@ -1037,8 +1037,8 @@ class UInt32(BaseInt[np.dtypes.UInt32DType, np.uint32], HasEndianness):
10371037
"""
10381038
A Zarr data type for arrays containing 32-bit unsigned integers.
10391039
1040-
Wraps the NumPy ``np.dtypes.UInt32DType`` data type. Scalars for this data type are instances of
1041-
``np.uint32``.
1040+
Wraps the ``numpy.dtypes.UInt32DType`` data type. Scalars for this data type are instances of
1041+
``numpy.uint32``.
10421042
10431043
Attributes
10441044
----------
@@ -1193,8 +1193,8 @@ class Int64(BaseInt[np.dtypes.Int64DType, np.int64], HasEndianness):
11931193
"""
11941194
A Zarr data type for arrays containing 64-bit signed integers.
11951195
1196-
Wraps the NumPy ``np.dtypes.Int64DType`` data type. Scalars for this data type are instances of
1197-
``np.int64``.
1196+
Wraps the ``numpy.dtypes.Int64DType`` data type. Scalars for this data type are instances of
1197+
``numpy.int64``.
11981198
11991199
Attributes
12001200
----------
@@ -1349,8 +1349,8 @@ class UInt64(BaseInt[np.dtypes.UInt64DType, np.uint64], HasEndianness):
13491349
"""
13501350
A Zarr data type for arrays containing 64-bit unsigned integers.
13511351
1352-
Wraps the NumPy ``np.dtypes.UInt64DType`` data type. Scalars for this data type
1353-
are instances of ``np.uint64``.
1352+
Wraps the ``numpy.dtypes.UInt64DType`` data type. Scalars for this data type
1353+
are instances of ``numpy.uint64``.
13541354
13551355
Attributes
13561356
----------

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ class FixedLengthUTF32(
6262
"""
6363
A Zarr data type for arrays containing fixed-length UTF-32 strings.
6464
65-
Wraps the NumPy ``np.dtypes.StrDType`` data type. Scalars for this data type are instances of
66-
``np.str_``.
65+
Wraps the ``numpy.dtypes.StrDType`` data type. Scalars for this data type are instances of
66+
``numpy.str_``.
6767
6868
Attributes
6969
----------
@@ -244,7 +244,7 @@ def default_scalar(self) -> np.str_:
244244
245245
Returns
246246
-------
247-
np.str_
247+
numpy.str_
248248
The default scalar value.
249249
"""
250250
return np.str_("")
@@ -280,7 +280,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.str_:
280280
281281
Returns
282282
-------
283-
np.str_
283+
numpy.str_
284284
The native scalar value.
285285
"""
286286
if check_json_str(data):
@@ -315,7 +315,7 @@ def cast_scalar(self, data: object) -> np.str_:
315315
316316
Returns
317317
-------
318-
np.str_
318+
numpy.str_
319319
The native scalar value.
320320
"""
321321
if self._check_scalar(data):
@@ -643,7 +643,7 @@ class VariableLengthUTF8(UTF8Base[np.dtypes.StringDType]): # type: ignore[type-
643643
"""
644644
A Zarr data type for arrays containing variable-length UTF-8 strings.
645645
646-
Wraps the NumPy ``np.dtypes.StringDType`` data type. Scalars for this data type are instances
646+
Wraps the ``numpy.dtypes.StringDType`` data type. Scalars for this data type are instances
647647
of ``str``.
648648
649649
@@ -677,7 +677,7 @@ class VariableLengthUTF8(UTF8Base[np.dtypes.ObjectDType]): # type: ignore[no-re
677677
"""
678678
A Zarr data type for arrays containing variable-length UTF-8 strings.
679679
680-
Wraps the NumPy ``np.dtypes.ObjectDType`` data type. Scalars for this data type are instances
680+
Wraps the ``numpy.dtypes.ObjectDType`` data type. Scalars for this data type are instances
681681
of ``str``.
682682
683683

0 commit comments

Comments
 (0)