numpy 2.3.3__cp313-cp313t-win32.whl → 2.3.4__cp313-cp313t-win32.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of numpy might be problematic. Click here for more details.
- numpy/__config__.py +4 -4
- numpy/__init__.pyi +819 -218
- numpy/_core/_multiarray_tests.cp313t-win32.lib +0 -0
- numpy/_core/_multiarray_tests.cp313t-win32.pyd +0 -0
- numpy/_core/_multiarray_umath.cp313t-win32.lib +0 -0
- numpy/_core/_multiarray_umath.cp313t-win32.pyd +0 -0
- numpy/_core/_operand_flag_tests.cp313t-win32.lib +0 -0
- numpy/_core/_operand_flag_tests.cp313t-win32.pyd +0 -0
- numpy/_core/_rational_tests.cp313t-win32.lib +0 -0
- numpy/_core/_rational_tests.cp313t-win32.pyd +0 -0
- numpy/_core/_simd.cp313t-win32.lib +0 -0
- numpy/_core/_simd.cp313t-win32.pyd +0 -0
- numpy/_core/_struct_ufunc_tests.cp313t-win32.lib +0 -0
- numpy/_core/_struct_ufunc_tests.cp313t-win32.pyd +0 -0
- numpy/_core/_ufunc_config.py +2 -0
- numpy/_core/_ufunc_config.pyi +52 -6
- numpy/_core/_umath_tests.cp313t-win32.lib +0 -0
- numpy/_core/_umath_tests.cp313t-win32.pyd +0 -0
- numpy/_core/lib/npymath.lib +0 -0
- numpy/_core/lib/pkgconfig/numpy.pc +1 -1
- numpy/_core/numerictypes.py +1 -1
- numpy/_core/tests/test_api.py +34 -1
- numpy/_core/tests/test_numerictypes.py +29 -0
- numpy/_core/tests/test_stringdtype.py +16 -16
- numpy/_core/tests/test_strings.py +15 -0
- numpy/_core/tests/test_umath.py +12 -0
- numpy/exceptions.pyi +2 -0
- numpy/fft/_pocketfft_umath.cp313t-win32.lib +0 -0
- numpy/fft/_pocketfft_umath.cp313t-win32.pyd +0 -0
- numpy/lib/_histograms_impl.pyi +8 -8
- numpy/lib/_index_tricks_impl.pyi +12 -0
- numpy/lib/_polynomial_impl.pyi +10 -8
- numpy/lib/mixins.pyi +2 -0
- numpy/lib/tests/test_index_tricks.py +5 -0
- numpy/linalg/_linalg.pyi +32 -39
- numpy/linalg/_umath_linalg.cp313t-win32.lib +0 -0
- numpy/linalg/_umath_linalg.cp313t-win32.pyd +0 -0
- numpy/linalg/lapack_lite.cp313t-win32.lib +0 -0
- numpy/linalg/lapack_lite.cp313t-win32.pyd +0 -0
- numpy/ma/extras.pyi +4 -0
- numpy/random/_bounded_integers.cp313t-win32.lib +0 -0
- numpy/random/_bounded_integers.cp313t-win32.pyd +0 -0
- numpy/random/_common.cp313t-win32.lib +0 -0
- numpy/random/_common.cp313t-win32.pyd +0 -0
- numpy/random/_generator.cp313t-win32.lib +0 -0
- numpy/random/_generator.cp313t-win32.pyd +0 -0
- numpy/random/_mt19937.cp313t-win32.lib +0 -0
- numpy/random/_mt19937.cp313t-win32.pyd +0 -0
- numpy/random/_pcg64.cp313t-win32.lib +0 -0
- numpy/random/_pcg64.cp313t-win32.pyd +0 -0
- numpy/random/_philox.cp313t-win32.lib +0 -0
- numpy/random/_philox.cp313t-win32.pyd +0 -0
- numpy/random/_sfc64.cp313t-win32.lib +0 -0
- numpy/random/_sfc64.cp313t-win32.pyd +0 -0
- numpy/random/bit_generator.cp313t-win32.lib +0 -0
- numpy/random/bit_generator.cp313t-win32.pyd +0 -0
- numpy/random/lib/npyrandom.lib +0 -0
- numpy/random/mtrand.cp313t-win32.lib +0 -0
- numpy/random/mtrand.cp313t-win32.pyd +0 -0
- numpy/random/tests/test_generator_mt19937.py +5 -0
- numpy/testing/_private/extbuild.pyi +3 -3
- numpy/testing/_private/utils.pyi +1 -1
- numpy/typing/tests/data/fail/bitwise_ops.pyi +3 -3
- numpy/typing/tests/data/fail/scalars.pyi +6 -6
- numpy/typing/tests/data/reveal/arithmetic.pyi +29 -29
- numpy/typing/tests/data/reveal/array_constructors.pyi +5 -5
- numpy/typing/tests/data/reveal/bitwise_ops.pyi +10 -11
- numpy/typing/tests/data/reveal/linalg.pyi +6 -6
- numpy/typing/tests/data/reveal/mod.pyi +18 -19
- numpy/version.py +2 -2
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/METADATA +1 -1
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/RECORD +75 -76
- numpy/_typing/_callable.pyi +0 -279
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/LICENSE.txt +0 -0
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/WHEEL +0 -0
- {numpy-2.3.3.dist-info → numpy-2.3.4.dist-info}/entry_points.txt +0 -0
|
Binary file
|
numpy/random/lib/npyrandom.lib
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1858,6 +1858,11 @@ class TestRandomDist:
|
|
|
1858
1858
|
[2.07093587449261, 0.73073890064369]])
|
|
1859
1859
|
assert_array_almost_equal(actual, desired, decimal=14)
|
|
1860
1860
|
|
|
1861
|
+
def test_wald_nonnegative(self):
|
|
1862
|
+
random = Generator(MT19937(self.seed))
|
|
1863
|
+
samples = random.wald(mean=1e9, scale=2.25, size=1000)
|
|
1864
|
+
assert_(np.all(samples >= 0.0))
|
|
1865
|
+
|
|
1861
1866
|
def test_weibull(self):
|
|
1862
1867
|
random = Generator(MT19937(self.seed))
|
|
1863
1868
|
actual = random.weibull(a=1.23, size=(3, 2))
|
|
@@ -10,7 +10,7 @@ def build_and_import_extension(
|
|
|
10
10
|
*,
|
|
11
11
|
prologue: str = "",
|
|
12
12
|
build_dir: pathlib.Path | None = None,
|
|
13
|
-
include_dirs: Sequence[str] =
|
|
13
|
+
include_dirs: Sequence[str] | None = None,
|
|
14
14
|
more_init: str = "",
|
|
15
15
|
) -> types.ModuleType: ...
|
|
16
16
|
|
|
@@ -20,6 +20,6 @@ def compile_extension_module(
|
|
|
20
20
|
builddir: pathlib.Path,
|
|
21
21
|
include_dirs: Sequence[str],
|
|
22
22
|
source_string: str,
|
|
23
|
-
libraries: Sequence[str] =
|
|
24
|
-
library_dirs: Sequence[str] =
|
|
23
|
+
libraries: Sequence[str] | None = None,
|
|
24
|
+
library_dirs: Sequence[str] | None = None,
|
|
25
25
|
) -> pathlib.Path: ...
|
numpy/testing/_private/utils.pyi
CHANGED
|
@@ -170,7 +170,7 @@ else:
|
|
|
170
170
|
def memusage() -> NoReturn: ...
|
|
171
171
|
|
|
172
172
|
if sys.platform == "linux":
|
|
173
|
-
def jiffies(_proc_pid_stat: StrOrBytesPath =
|
|
173
|
+
def jiffies(_proc_pid_stat: StrOrBytesPath | None = None, _load_time: list[float] | None = None) -> int: ...
|
|
174
174
|
else:
|
|
175
175
|
def jiffies(_load_time: list[float] = []) -> int: ...
|
|
176
176
|
|
|
@@ -9,9 +9,9 @@ i = int()
|
|
|
9
9
|
f8 = np.float64()
|
|
10
10
|
|
|
11
11
|
b_ >> f8 # type: ignore[operator]
|
|
12
|
-
i8 << f8 # type: ignore[
|
|
12
|
+
i8 << f8 # type: ignore[operator]
|
|
13
13
|
i | f8 # type: ignore[operator]
|
|
14
|
-
i8 ^ f8 # type: ignore[
|
|
15
|
-
u8 & f8 # type: ignore[
|
|
14
|
+
i8 ^ f8 # type: ignore[operator]
|
|
15
|
+
u8 & f8 # type: ignore[operator]
|
|
16
16
|
~f8 # type: ignore[operator]
|
|
17
17
|
# TODO: Certain mixes like i4 << u8 go to float and thus should fail
|
|
@@ -47,12 +47,12 @@ np.uint64(A()) # type: ignore[arg-type]
|
|
|
47
47
|
np.void("test") # type: ignore[call-overload]
|
|
48
48
|
np.void("test", dtype=None) # type: ignore[call-overload]
|
|
49
49
|
|
|
50
|
-
np.generic(1) # type: ignore[abstract]
|
|
51
|
-
np.number(1) # type: ignore[abstract]
|
|
52
|
-
np.integer(1) # type: ignore[abstract]
|
|
53
|
-
np.inexact(1) # type: ignore[abstract]
|
|
54
|
-
np.character("test") # type: ignore[abstract]
|
|
55
|
-
np.flexible(b"test") # type: ignore[abstract]
|
|
50
|
+
np.generic(1) # type: ignore[abstract, call-arg]
|
|
51
|
+
np.number(1) # type: ignore[abstract, call-arg]
|
|
52
|
+
np.integer(1) # type: ignore[abstract, call-arg]
|
|
53
|
+
np.inexact(1) # type: ignore[abstract, call-arg]
|
|
54
|
+
np.character("test") # type: ignore[abstract, call-arg]
|
|
55
|
+
np.flexible(b"test") # type: ignore[abstract, call-arg]
|
|
56
56
|
|
|
57
57
|
np.float64(value=0.0) # type: ignore[call-arg]
|
|
58
58
|
np.int64(value=0) # type: ignore[call-arg]
|
|
@@ -3,7 +3,7 @@ from typing import Any, assert_type
|
|
|
3
3
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
import numpy.typing as npt
|
|
6
|
-
from numpy._typing import
|
|
6
|
+
from numpy._typing import _64Bit, _128Bit
|
|
7
7
|
|
|
8
8
|
b: bool
|
|
9
9
|
c: complex
|
|
@@ -487,7 +487,7 @@ assert_type(c8 / b_, np.complex64)
|
|
|
487
487
|
|
|
488
488
|
# Complex
|
|
489
489
|
|
|
490
|
-
assert_type(c16 + f16, np.
|
|
490
|
+
assert_type(c16 + f16, np.complexfloating)
|
|
491
491
|
assert_type(c16 + c16, np.complex128)
|
|
492
492
|
assert_type(c16 + f8, np.complex128)
|
|
493
493
|
assert_type(c16 + i8, np.complex128)
|
|
@@ -500,12 +500,12 @@ assert_type(c16 + c, np.complex128)
|
|
|
500
500
|
assert_type(c16 + f, np.complex128)
|
|
501
501
|
assert_type(c16 + AR_f, npt.NDArray[np.complex128])
|
|
502
502
|
|
|
503
|
-
assert_type(f16 + c16, np.
|
|
503
|
+
assert_type(f16 + c16, np.complexfloating)
|
|
504
504
|
assert_type(c16 + c16, np.complex128)
|
|
505
505
|
assert_type(f8 + c16, np.complex128)
|
|
506
506
|
assert_type(i8 + c16, np.complex128)
|
|
507
507
|
assert_type(c8 + c16, np.complex128 | np.complex64)
|
|
508
|
-
assert_type(f4 + c16, np.
|
|
508
|
+
assert_type(f4 + c16, np.complexfloating)
|
|
509
509
|
assert_type(i4 + c16, np.complex128)
|
|
510
510
|
assert_type(b_ + c16, np.complex128)
|
|
511
511
|
assert_type(b + c16, np.complex128)
|
|
@@ -513,10 +513,10 @@ assert_type(c + c16, np.complex128)
|
|
|
513
513
|
assert_type(f + c16, np.complex128)
|
|
514
514
|
assert_type(AR_f + c16, npt.NDArray[np.complex128])
|
|
515
515
|
|
|
516
|
-
assert_type(c8 + f16, np.
|
|
516
|
+
assert_type(c8 + f16, np.complex64 | np.complexfloating[_128Bit, _128Bit])
|
|
517
517
|
assert_type(c8 + c16, np.complex64 | np.complex128)
|
|
518
518
|
assert_type(c8 + f8, np.complex64 | np.complex128)
|
|
519
|
-
assert_type(c8 + i8, np.
|
|
519
|
+
assert_type(c8 + i8, np.complex64 | np.complexfloating[_64Bit, _64Bit])
|
|
520
520
|
assert_type(c8 + c8, np.complex64)
|
|
521
521
|
assert_type(c8 + f4, np.complex64)
|
|
522
522
|
assert_type(c8 + i4, np.complex64)
|
|
@@ -541,7 +541,7 @@ assert_type(AR_f + c8, npt.NDArray[np.complexfloating])
|
|
|
541
541
|
|
|
542
542
|
# Float
|
|
543
543
|
|
|
544
|
-
assert_type(f8 + f16, np.
|
|
544
|
+
assert_type(f8 + f16, np.floating)
|
|
545
545
|
assert_type(f8 + f8, np.float64)
|
|
546
546
|
assert_type(f8 + i8, np.float64)
|
|
547
547
|
assert_type(f8 + f4, np.float64)
|
|
@@ -552,44 +552,44 @@ assert_type(f8 + c, np.float64 | np.complex128)
|
|
|
552
552
|
assert_type(f8 + f, np.float64)
|
|
553
553
|
assert_type(f8 + AR_f, npt.NDArray[np.float64])
|
|
554
554
|
|
|
555
|
-
assert_type(f16 + f8, np.floating
|
|
555
|
+
assert_type(f16 + f8, np.floating)
|
|
556
556
|
assert_type(f8 + f8, np.float64)
|
|
557
557
|
assert_type(i8 + f8, np.float64)
|
|
558
|
-
assert_type(f4 + f8, np.
|
|
559
|
-
assert_type(i4 + f8,np.float64)
|
|
558
|
+
assert_type(f4 + f8, np.floating)
|
|
559
|
+
assert_type(i4 + f8, np.float64)
|
|
560
560
|
assert_type(b_ + f8, np.float64)
|
|
561
561
|
assert_type(b + f8, np.float64)
|
|
562
562
|
assert_type(c + f8, np.complex128 | np.float64)
|
|
563
563
|
assert_type(f + f8, np.float64)
|
|
564
564
|
assert_type(AR_f + f8, npt.NDArray[np.float64])
|
|
565
565
|
|
|
566
|
-
assert_type(f4 + f16, np.
|
|
567
|
-
assert_type(f4 + f8, np.
|
|
568
|
-
assert_type(f4 + i8, np.
|
|
566
|
+
assert_type(f4 + f16, np.floating)
|
|
567
|
+
assert_type(f4 + f8, np.floating)
|
|
568
|
+
assert_type(f4 + i8, np.floating)
|
|
569
569
|
assert_type(f4 + f4, np.float32)
|
|
570
|
-
assert_type(f4 + i4, np.
|
|
570
|
+
assert_type(f4 + i4, np.floating)
|
|
571
571
|
assert_type(f4 + b_, np.float32)
|
|
572
572
|
assert_type(f4 + b, np.float32)
|
|
573
|
-
assert_type(f4 + c, np.
|
|
574
|
-
assert_type(f4 + f, np.float32
|
|
573
|
+
assert_type(f4 + c, np.complexfloating)
|
|
574
|
+
assert_type(f4 + f, np.float32)
|
|
575
575
|
assert_type(f4 + AR_f, npt.NDArray[np.float64])
|
|
576
576
|
|
|
577
|
-
assert_type(f16 + f4, np.floating
|
|
577
|
+
assert_type(f16 + f4, np.floating)
|
|
578
578
|
assert_type(f8 + f4, np.float64)
|
|
579
|
-
assert_type(i8 + f4, np.floating
|
|
579
|
+
assert_type(i8 + f4, np.floating)
|
|
580
580
|
assert_type(f4 + f4, np.float32)
|
|
581
|
-
assert_type(i4 + f4, np.
|
|
581
|
+
assert_type(i4 + f4, np.floating)
|
|
582
582
|
assert_type(b_ + f4, np.float32)
|
|
583
583
|
assert_type(b + f4, np.float32)
|
|
584
|
-
assert_type(c + f4, np.
|
|
585
|
-
assert_type(f + f4, np.
|
|
584
|
+
assert_type(c + f4, np.complexfloating)
|
|
585
|
+
assert_type(f + f4, np.float32)
|
|
586
586
|
assert_type(AR_f + f4, npt.NDArray[np.float64])
|
|
587
587
|
|
|
588
588
|
# Int
|
|
589
589
|
|
|
590
590
|
assert_type(i8 + i8, np.int64)
|
|
591
591
|
assert_type(i8 + u8, Any)
|
|
592
|
-
assert_type(i8 + i4, np.signedinteger
|
|
592
|
+
assert_type(i8 + i4, np.signedinteger)
|
|
593
593
|
assert_type(i8 + u4, Any)
|
|
594
594
|
assert_type(i8 + b_, np.int64)
|
|
595
595
|
assert_type(i8 + b, np.int64)
|
|
@@ -599,7 +599,7 @@ assert_type(i8 + AR_f, npt.NDArray[np.float64])
|
|
|
599
599
|
|
|
600
600
|
assert_type(u8 + u8, np.uint64)
|
|
601
601
|
assert_type(u8 + i4, Any)
|
|
602
|
-
assert_type(u8 + u4, np.unsignedinteger
|
|
602
|
+
assert_type(u8 + u4, np.unsignedinteger)
|
|
603
603
|
assert_type(u8 + b_, np.uint64)
|
|
604
604
|
assert_type(u8 + b, np.uint64)
|
|
605
605
|
assert_type(u8 + c, np.complex128)
|
|
@@ -608,7 +608,7 @@ assert_type(u8 + AR_f, npt.NDArray[np.float64])
|
|
|
608
608
|
|
|
609
609
|
assert_type(i8 + i8, np.int64)
|
|
610
610
|
assert_type(u8 + i8, Any)
|
|
611
|
-
assert_type(i4 + i8, np.signedinteger
|
|
611
|
+
assert_type(i4 + i8, np.signedinteger)
|
|
612
612
|
assert_type(u4 + i8, Any)
|
|
613
613
|
assert_type(b_ + i8, np.int64)
|
|
614
614
|
assert_type(b + i8, np.int64)
|
|
@@ -618,14 +618,14 @@ assert_type(AR_f + i8, npt.NDArray[np.float64])
|
|
|
618
618
|
|
|
619
619
|
assert_type(u8 + u8, np.uint64)
|
|
620
620
|
assert_type(i4 + u8, Any)
|
|
621
|
-
assert_type(u4 + u8, np.unsignedinteger
|
|
621
|
+
assert_type(u4 + u8, np.unsignedinteger)
|
|
622
622
|
assert_type(b_ + u8, np.uint64)
|
|
623
623
|
assert_type(b + u8, np.uint64)
|
|
624
624
|
assert_type(c + u8, np.complex128)
|
|
625
625
|
assert_type(f + u8, np.float64)
|
|
626
626
|
assert_type(AR_f + u8, npt.NDArray[np.float64])
|
|
627
627
|
|
|
628
|
-
assert_type(i4 + i8, np.signedinteger
|
|
628
|
+
assert_type(i4 + i8, np.signedinteger)
|
|
629
629
|
assert_type(i4 + i4, np.int32)
|
|
630
630
|
assert_type(i4 + b_, np.int32)
|
|
631
631
|
assert_type(i4 + b, np.int32)
|
|
@@ -633,13 +633,13 @@ assert_type(i4 + AR_f, npt.NDArray[np.float64])
|
|
|
633
633
|
|
|
634
634
|
assert_type(u4 + i8, Any)
|
|
635
635
|
assert_type(u4 + i4, Any)
|
|
636
|
-
assert_type(u4 + u8, np.unsignedinteger
|
|
636
|
+
assert_type(u4 + u8, np.unsignedinteger)
|
|
637
637
|
assert_type(u4 + u4, np.uint32)
|
|
638
638
|
assert_type(u4 + b_, np.uint32)
|
|
639
639
|
assert_type(u4 + b, np.uint32)
|
|
640
640
|
assert_type(u4 + AR_f, npt.NDArray[np.float64])
|
|
641
641
|
|
|
642
|
-
assert_type(i8 + i4, np.signedinteger
|
|
642
|
+
assert_type(i8 + i4, np.signedinteger)
|
|
643
643
|
assert_type(i4 + i4, np.int32)
|
|
644
644
|
assert_type(b_ + i4, np.int32)
|
|
645
645
|
assert_type(b + i4, np.int32)
|
|
@@ -647,7 +647,7 @@ assert_type(AR_f + i4, npt.NDArray[np.float64])
|
|
|
647
647
|
|
|
648
648
|
assert_type(i8 + u4, Any)
|
|
649
649
|
assert_type(i4 + u4, Any)
|
|
650
|
-
assert_type(u8 + u4, np.unsignedinteger
|
|
650
|
+
assert_type(u8 + u4, np.unsignedinteger)
|
|
651
651
|
assert_type(u4 + u4, np.uint32)
|
|
652
652
|
assert_type(b_ + u4, np.uint32)
|
|
653
653
|
assert_type(b + u4, np.uint32)
|
|
@@ -53,7 +53,7 @@ assert_type(np.empty([1, 5, 6], dtype='c16'), npt.NDArray[Any])
|
|
|
53
53
|
assert_type(np.empty(mixed_shape), npt.NDArray[np.float64])
|
|
54
54
|
|
|
55
55
|
assert_type(np.concatenate(A), npt.NDArray[np.float64])
|
|
56
|
-
assert_type(np.concatenate([A, A]), Any) # pyright correctly infers this as NDArray[float64]
|
|
56
|
+
assert_type(np.concatenate([A, A]), npt.NDArray[Any]) # pyright correctly infers this as NDArray[float64]
|
|
57
57
|
assert_type(np.concatenate([[1], A]), npt.NDArray[Any])
|
|
58
58
|
assert_type(np.concatenate([[1], [1]]), npt.NDArray[Any])
|
|
59
59
|
assert_type(np.concatenate((A, A)), npt.NDArray[np.float64])
|
|
@@ -222,19 +222,19 @@ assert_type(np.atleast_3d(A), npt.NDArray[np.float64])
|
|
|
222
222
|
assert_type(np.atleast_3d(A, A), tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]])
|
|
223
223
|
assert_type(np.atleast_3d(A, A, A), tuple[npt.NDArray[np.float64], ...])
|
|
224
224
|
|
|
225
|
-
assert_type(np.vstack([A, A]),
|
|
225
|
+
assert_type(np.vstack([A, A]), npt.NDArray[np.float64])
|
|
226
226
|
assert_type(np.vstack([A, A], dtype=np.float32), npt.NDArray[np.float32])
|
|
227
227
|
assert_type(np.vstack([A, C]), npt.NDArray[Any])
|
|
228
228
|
assert_type(np.vstack([C, C]), npt.NDArray[Any])
|
|
229
229
|
|
|
230
|
-
assert_type(np.hstack([A, A]),
|
|
230
|
+
assert_type(np.hstack([A, A]), npt.NDArray[np.float64])
|
|
231
231
|
assert_type(np.hstack([A, A], dtype=np.float32), npt.NDArray[np.float32])
|
|
232
232
|
|
|
233
|
-
assert_type(np.stack([A, A]),
|
|
233
|
+
assert_type(np.stack([A, A]), npt.NDArray[np.float64])
|
|
234
234
|
assert_type(np.stack([A, A], dtype=np.float32), npt.NDArray[np.float32])
|
|
235
235
|
assert_type(np.stack([A, C]), npt.NDArray[Any])
|
|
236
236
|
assert_type(np.stack([C, C]), npt.NDArray[Any])
|
|
237
|
-
assert_type(np.stack([A, A], axis=0),
|
|
237
|
+
assert_type(np.stack([A, A], axis=0), npt.NDArray[np.float64])
|
|
238
238
|
assert_type(np.stack([A, A], out=B), SubClass[np.float64])
|
|
239
239
|
|
|
240
240
|
assert_type(np.block([[A, A], [A, A]]), npt.NDArray[Any]) # pyright correctly infers this as NDArray[float64]
|
|
@@ -3,7 +3,6 @@ from typing import Literal as L
|
|
|
3
3
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
import numpy.typing as npt
|
|
6
|
-
from numpy._typing import _32Bit, _64Bit
|
|
7
6
|
|
|
8
7
|
FalseType: TypeAlias = L[False]
|
|
9
8
|
TrueType: TypeAlias = L[True]
|
|
@@ -44,11 +43,11 @@ assert_type(i4 | i4, np.int32)
|
|
|
44
43
|
assert_type(i4 ^ i4, np.int32)
|
|
45
44
|
assert_type(i4 & i4, np.int32)
|
|
46
45
|
|
|
47
|
-
assert_type(i8 << i4, np.signedinteger
|
|
48
|
-
assert_type(i8 >> i4, np.signedinteger
|
|
49
|
-
assert_type(i8 | i4, np.signedinteger
|
|
50
|
-
assert_type(i8 ^ i4, np.signedinteger
|
|
51
|
-
assert_type(i8 & i4, np.signedinteger
|
|
46
|
+
assert_type(i8 << i4, np.signedinteger)
|
|
47
|
+
assert_type(i8 >> i4, np.signedinteger)
|
|
48
|
+
assert_type(i8 | i4, np.signedinteger)
|
|
49
|
+
assert_type(i8 ^ i4, np.signedinteger)
|
|
50
|
+
assert_type(i8 & i4, np.signedinteger)
|
|
52
51
|
|
|
53
52
|
assert_type(i8 << b_, np.int64)
|
|
54
53
|
assert_type(i8 >> b_, np.int64)
|
|
@@ -86,11 +85,11 @@ assert_type(u4 | i4, np.signedinteger)
|
|
|
86
85
|
assert_type(u4 ^ i4, np.signedinteger)
|
|
87
86
|
assert_type(u4 & i4, np.signedinteger)
|
|
88
87
|
|
|
89
|
-
assert_type(u4 << i, np.
|
|
90
|
-
assert_type(u4 >> i, np.
|
|
91
|
-
assert_type(u4 | i, np.
|
|
92
|
-
assert_type(u4 ^ i, np.
|
|
93
|
-
assert_type(u4 & i, np.
|
|
88
|
+
assert_type(u4 << i, np.uint32)
|
|
89
|
+
assert_type(u4 >> i, np.uint32)
|
|
90
|
+
assert_type(u4 | i, np.uint32)
|
|
91
|
+
assert_type(u4 ^ i, np.uint32)
|
|
92
|
+
assert_type(u4 & i, np.uint32)
|
|
94
93
|
|
|
95
94
|
assert_type(u8 << b_, np.uint64)
|
|
96
95
|
assert_type(u8 >> b_, np.uint64)
|
|
@@ -43,9 +43,9 @@ assert_type(np.linalg.cholesky(AR_i8), npt.NDArray[np.float64])
|
|
|
43
43
|
assert_type(np.linalg.cholesky(AR_f8), npt.NDArray[np.floating])
|
|
44
44
|
assert_type(np.linalg.cholesky(AR_c16), npt.NDArray[np.complexfloating])
|
|
45
45
|
|
|
46
|
-
assert_type(np.linalg.outer(AR_i8, AR_i8), npt.NDArray[np.
|
|
47
|
-
assert_type(np.linalg.outer(AR_f8, AR_f8), npt.NDArray[np.
|
|
48
|
-
assert_type(np.linalg.outer(AR_c16, AR_c16), npt.NDArray[np.
|
|
46
|
+
assert_type(np.linalg.outer(AR_i8, AR_i8), npt.NDArray[np.int64])
|
|
47
|
+
assert_type(np.linalg.outer(AR_f8, AR_f8), npt.NDArray[np.float64])
|
|
48
|
+
assert_type(np.linalg.outer(AR_c16, AR_c16), npt.NDArray[np.complex128])
|
|
49
49
|
assert_type(np.linalg.outer(AR_b, AR_b), npt.NDArray[np.bool])
|
|
50
50
|
assert_type(np.linalg.outer(AR_O, AR_O), npt.NDArray[np.object_])
|
|
51
51
|
assert_type(np.linalg.outer(AR_i8, AR_m), npt.NDArray[np.timedelta64])
|
|
@@ -127,6 +127,6 @@ assert_type(np.linalg.cross(AR_i8, AR_i8), npt.NDArray[np.signedinteger])
|
|
|
127
127
|
assert_type(np.linalg.cross(AR_f8, AR_f8), npt.NDArray[np.floating])
|
|
128
128
|
assert_type(np.linalg.cross(AR_c16, AR_c16), npt.NDArray[np.complexfloating])
|
|
129
129
|
|
|
130
|
-
assert_type(np.linalg.matmul(AR_i8, AR_i8), npt.NDArray[np.
|
|
131
|
-
assert_type(np.linalg.matmul(AR_f8, AR_f8), npt.NDArray[np.
|
|
132
|
-
assert_type(np.linalg.matmul(AR_c16, AR_c16), npt.NDArray[np.
|
|
130
|
+
assert_type(np.linalg.matmul(AR_i8, AR_i8), npt.NDArray[np.int64])
|
|
131
|
+
assert_type(np.linalg.matmul(AR_f8, AR_f8), npt.NDArray[np.float64])
|
|
132
|
+
assert_type(np.linalg.matmul(AR_c16, AR_c16), npt.NDArray[np.complex128])
|
|
@@ -4,7 +4,6 @@ from typing import assert_type
|
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
6
|
import numpy.typing as npt
|
|
7
|
-
from numpy._typing import _64Bit
|
|
8
7
|
|
|
9
8
|
f8: np.float64
|
|
10
9
|
i8: np.int64
|
|
@@ -109,51 +108,51 @@ assert_type(divmod(AR_b, b_), tuple[npt.NDArray[np.int8], npt.NDArray[np.int8]])
|
|
|
109
108
|
|
|
110
109
|
assert_type(i8 % b, np.int64)
|
|
111
110
|
assert_type(i8 % i8, np.int64)
|
|
112
|
-
assert_type(i8 % f, np.float64
|
|
113
|
-
assert_type(i8 % f8, np.float64
|
|
114
|
-
assert_type(i4 % i8, np.
|
|
115
|
-
assert_type(i4 % f8, np.float64
|
|
111
|
+
assert_type(i8 % f, np.float64)
|
|
112
|
+
assert_type(i8 % f8, np.float64)
|
|
113
|
+
assert_type(i4 % i8, np.signedinteger)
|
|
114
|
+
assert_type(i4 % f8, np.float64)
|
|
116
115
|
assert_type(i4 % i4, np.int32)
|
|
117
|
-
assert_type(i4 % f4, np.
|
|
116
|
+
assert_type(i4 % f4, np.floating)
|
|
118
117
|
assert_type(i8 % AR_b, npt.NDArray[np.int64])
|
|
119
118
|
|
|
120
119
|
assert_type(divmod(i8, b), tuple[np.int64, np.int64])
|
|
121
|
-
assert_type(divmod(i8, i4), tuple[np.
|
|
120
|
+
assert_type(divmod(i8, i4), tuple[np.signedinteger, np.signedinteger])
|
|
122
121
|
assert_type(divmod(i8, i8), tuple[np.int64, np.int64])
|
|
123
122
|
# workarounds for https://github.com/microsoft/pyright/issues/9663
|
|
124
|
-
assert_type(i8.__divmod__(f), tuple[np.
|
|
125
|
-
assert_type(i8.__divmod__(f8), tuple[np.
|
|
126
|
-
assert_type(divmod(i8, f4), tuple[np.floating
|
|
123
|
+
assert_type(i8.__divmod__(f), tuple[np.float64, np.float64])
|
|
124
|
+
assert_type(i8.__divmod__(f8), tuple[np.float64, np.float64])
|
|
125
|
+
assert_type(divmod(i8, f4), tuple[np.floating, np.floating])
|
|
127
126
|
assert_type(divmod(i4, i4), tuple[np.int32, np.int32])
|
|
128
|
-
assert_type(divmod(i4, f4), tuple[np.
|
|
127
|
+
assert_type(divmod(i4, f4), tuple[np.floating, np.floating])
|
|
129
128
|
assert_type(divmod(i8, AR_b), tuple[npt.NDArray[np.int64], npt.NDArray[np.int64]])
|
|
130
129
|
|
|
131
130
|
assert_type(b % i8, np.int64)
|
|
132
|
-
assert_type(f % i8, np.float64
|
|
131
|
+
assert_type(f % i8, np.float64)
|
|
133
132
|
assert_type(i8 % i8, np.int64)
|
|
134
133
|
assert_type(f8 % i8, np.float64)
|
|
135
|
-
assert_type(i8 % i4, np.
|
|
134
|
+
assert_type(i8 % i4, np.signedinteger)
|
|
136
135
|
assert_type(f8 % i4, np.float64)
|
|
137
136
|
assert_type(i4 % i4, np.int32)
|
|
138
|
-
assert_type(f4 % i4, np.
|
|
137
|
+
assert_type(f4 % i4, np.floating)
|
|
139
138
|
assert_type(AR_b % i8, npt.NDArray[np.int64])
|
|
140
139
|
|
|
141
140
|
assert_type(divmod(b, i8), tuple[np.int64, np.int64])
|
|
142
|
-
assert_type(divmod(f, i8), tuple[np.
|
|
141
|
+
assert_type(divmod(f, i8), tuple[np.float64, np.float64])
|
|
143
142
|
assert_type(divmod(i8, i8), tuple[np.int64, np.int64])
|
|
144
143
|
assert_type(divmod(f8, i8), tuple[np.float64, np.float64])
|
|
145
|
-
assert_type(divmod(i4, i8), tuple[np.
|
|
144
|
+
assert_type(divmod(i4, i8), tuple[np.signedinteger, np.signedinteger])
|
|
146
145
|
assert_type(divmod(i4, i4), tuple[np.int32, np.int32])
|
|
147
146
|
# workarounds for https://github.com/microsoft/pyright/issues/9663
|
|
148
|
-
assert_type(f4.__divmod__(i8), tuple[np.floating
|
|
149
|
-
assert_type(f4.__divmod__(i4), tuple[np.
|
|
147
|
+
assert_type(f4.__divmod__(i8), tuple[np.floating, np.floating])
|
|
148
|
+
assert_type(f4.__divmod__(i4), tuple[np.floating, np.floating])
|
|
150
149
|
assert_type(AR_b.__divmod__(i8), tuple[npt.NDArray[np.int64], npt.NDArray[np.int64]])
|
|
151
150
|
|
|
152
151
|
# float
|
|
153
152
|
|
|
154
153
|
assert_type(f8 % b, np.float64)
|
|
155
154
|
assert_type(f8 % f, np.float64)
|
|
156
|
-
assert_type(i8 % f4, np.floating
|
|
155
|
+
assert_type(i8 % f4, np.floating)
|
|
157
156
|
assert_type(f4 % f4, np.float32)
|
|
158
157
|
assert_type(f8 % AR_b, npt.NDArray[np.float64])
|
|
159
158
|
|
numpy/version.py
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"""
|
|
3
3
|
Module to expose more detailed version info for the installed `numpy`
|
|
4
4
|
"""
|
|
5
|
-
version = "2.3.
|
|
5
|
+
version = "2.3.4"
|
|
6
6
|
__version__ = version
|
|
7
7
|
full_version = version
|
|
8
8
|
|
|
9
|
-
git_revision = "
|
|
9
|
+
git_revision = "1458b9e79d1a5755eae9adcb346758f449b6b430"
|
|
10
10
|
release = 'dev' not in version and '+' not in version
|
|
11
11
|
short_version = version.split("+")[0]
|