Skip to content

Commit bf15d71

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

File tree

10 files changed

+37
-37
lines changed

10 files changed

+37
-37
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ 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
26+
Wraps the ``np.dtypes.BoolDType`` data type. Scalars for this data type are instances of
2727
``np.bool_``.
2828
2929
Attributes

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ 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
40+
Wraps the ``np.dtypes.BytesDType`` data type. Scalars for this data type are instances of
4141
``np.bytes_``.
4242
4343
This data type is parametrized by an integral length which specifies size in bytes of each
@@ -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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ 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
352+
Wraps the ``np.dtypes.Complex64DType`` data type. Scalars for this data type
353353
are instances of ``np.complex64``.
354354
355355
Attributes
@@ -384,7 +384,7 @@ 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
387+
Wraps the ``np.dtypes.Complex128DType`` data type. Scalars for this data type
388388
are instances of ``np.complex128``.
389389
390390
Attributes

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ 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
320+
Wraps the ``np.dtypes.Float16DType`` data type. Scalars for this data type are instances
321321
of ``np.float16``.
322322
323323
Attributes
@@ -352,7 +352,7 @@ 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
355+
Wraps the ``np.dtypes.Float32DType`` data type. Scalars for this data type are instances
356356
of ``np.float32``.
357357
358358
Attributes
@@ -387,7 +387,7 @@ 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
390+
Wraps the ``np.dtypes.Float64DType`` data type. Scalars for this data type are instances
391391
of ``np.float64``.
392392
393393
Attributes

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ 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
261+
Wraps the ``np.dtypes.Int8DType`` data type. Scalars for this data type are
262262
instances of ``np.int8``.
263263
264264
Attributes
@@ -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 ``np.dtypes.UInt8DType`` data type. Scalars for this data type are instances of ``np.uint8``.
417417
418418
Attributes
419419
----------
@@ -557,7 +557,7 @@ 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
560+
Wraps the ``np.dtypes.Int16DType`` data type. Scalars for this data type are instances of
561561
``np.int16``.
562562
563563
Attributes
@@ -717,7 +717,7 @@ 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
720+
Wraps the ``np.dtypes.UInt16DType`` data type. Scalars for this data type are instances of
721721
``np.uint16``.
722722
723723
Attributes
@@ -877,7 +877,7 @@ 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
880+
Wraps the ``np.dtypes.Int32DType`` data type. Scalars for this data type are instances of
881881
``np.int32``.
882882
883883
Attributes
@@ -1037,7 +1037,7 @@ 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
1040+
Wraps the ``np.dtypes.UInt32DType`` data type. Scalars for this data type are instances of
10411041
``np.uint32``.
10421042
10431043
Attributes
@@ -1193,7 +1193,7 @@ 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
1196+
Wraps the ``np.dtypes.Int64DType`` data type. Scalars for this data type are instances of
11971197
``np.int64``.
11981198
11991199
Attributes
@@ -1349,7 +1349,7 @@ 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
1352+
Wraps the ``np.dtypes.UInt64DType`` data type. Scalars for this data type
13531353
are instances of ``np.uint64``.
13541354
13551355
Attributes

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ 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
65+
Wraps the ``np.dtypes.StrDType`` data type. Scalars for this data type are instances of
6666
``np.str_``.
6767
6868
Attributes
@@ -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 ``np.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 ``np.dtypes.ObjectDType`` data type. Scalars for this data type are instances
681681
of ``str``.
682682
683683

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def _cast_scalar_unchecked(self, data: StructuredScalarLike) -> np.void:
302302
303303
Returns
304304
-------
305-
np.void
305+
numpy.void
306306
The casted data as a numpy structured scalar.
307307
308308
Notes
@@ -335,7 +335,7 @@ def cast_scalar(self, data: object) -> np.void:
335335
336336
Returns
337337
-------
338-
np.void
338+
numpy.void
339339
The data cast as a NumPy structured scalar.
340340
341341
Raises
@@ -355,7 +355,7 @@ def default_scalar(self) -> np.void:
355355
356356
Returns
357357
-------
358-
np.void
358+
numpy.void
359359
The default scalar value, which is the scalar representation of 0
360360
cast to this structured data type.
361361
"""
@@ -375,7 +375,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.void:
375375
376376
Returns
377377
-------
378-
np.void
378+
numpy.void
379379
The NumPy structured scalar.
380380
381381
Raises

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def datetime_from_int(data: int, *, unit: DateTimeUnit, scale_factor: int) -> np
5858
5959
Returns
6060
-------
61-
np.datetime64
61+
numpy.datetime64
6262
The datetime64 value.
6363
"""
6464
dtype_name = f"datetime64[{scale_factor}{unit}]"
@@ -71,7 +71,7 @@ def datetimelike_to_int(data: np.datetime64 | np.timedelta64) -> int:
7171
7272
Parameters
7373
----------
74-
data : np.datetime64 | np.timedelta64
74+
data : np.datetime64 | numpy.timedelta64
7575
The value to convert.
7676
7777
Returns
@@ -273,7 +273,7 @@ class TimeDelta64(TimeDTypeBase[np.dtypes.TimeDelta64DType, np.timedelta64], Has
273273
"""
274274
A Zarr data type for arrays containing NumPy TimeDelta64 data.
275275
276-
Wraps the NumPy ``np.dtypesTimeDelta64DType`` data type. Scalars for this data type
276+
Wraps the ``np.dtypesTimeDelta64DType`` data type. Scalars for this data type
277277
are instances of ``np.timedelta64``.
278278
279279
Attributes
@@ -463,7 +463,7 @@ def _cast_scalar_unchecked(self, data: TimeDeltaLike) -> np.timedelta64:
463463
464464
Returns
465465
-------
466-
np.timedelta64
466+
numpy.timedelta64
467467
The input data cast as a numpy timedelta64 scalar.
468468
"""
469469
return self.to_native_dtype().type(data, f"{self.scale_factor}{self.unit}")
@@ -500,7 +500,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.timedel
500500
501501
Returns
502502
-------
503-
np.timedelta64
503+
numpy.timedelta64
504504
The scalar value of this data type.
505505
506506
Raises
@@ -518,7 +518,7 @@ class DateTime64(TimeDTypeBase[np.dtypes.DateTime64DType, np.datetime64], HasEnd
518518
"""
519519
A Zarr data type for arrays containing NumPy Datetime64 data.
520520
521-
Wraps the NumPy ``np.dtypesTimeDelta64DType`` data type. Scalars for this data type
521+
Wraps the ``np.dtypesTimeDelta64DType`` data type. Scalars for this data type
522522
are instances of ``np.datetime64``.
523523
524524
Attributes
@@ -706,7 +706,7 @@ def _cast_scalar_unchecked(self, data: DateTimeLike) -> np.datetime64:
706706
707707
Returns
708708
-------
709-
np.datetime64
709+
numpy.datetime64
710710
The casted data as a numpy datetime scalar.
711711
"""
712712
return self.to_native_dtype().type(data, f"{self.scale_factor}{self.unit}")
@@ -722,7 +722,7 @@ def cast_scalar(self, data: object) -> np.datetime64:
722722
723723
Returns
724724
-------
725-
np.datetime64
725+
numpy.datetime64
726726
The data cast as a numpy datetime scalar.
727727
728728
Raises
@@ -758,7 +758,7 @@ def from_json_scalar(self, data: JSON, *, zarr_format: ZarrFormat) -> np.datetim
758758
759759
Returns
760760
-------
761-
np.datetime64
761+
numpy.datetime64
762762
The numpy datetime scalar.
763763
764764
Raises

src/zarr/core/indexing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ def slice_to_range(s: slice, length: int) -> range:
799799

800800

801801
def ix_(selection: Any, shape: ChunkCoords) -> npt.NDArray[np.intp]:
802-
"""Convert an orthogonal selection to a numpy advanced (fancy) selection, like ``numpy.ix_``
802+
"""Convert an orthogonal selection to a numpy advanced (fancy) selection, like ``np.ix_``
803803
but with support for slices and single ints."""
804804

805805
# normalisation

0 commit comments

Comments
 (0)