diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2023-03-02 21:08:21 +0000 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2023-03-02 21:10:41 +0000 |
commit | 3dcc33aa585339f36639f78da70bb35f26609bef (patch) | |
tree | 56a740302fb3139c79990bdd857d677153196ea1 | |
parent | 2f0bc34852f98cf38ebba94e646c6444d282bf69 (diff) | |
download | numpy-3dcc33aa585339f36639f78da70bb35f26609bef.tar.gz |
MAINT: add dates/versions to deprecations, fix linter complaint
[skip cirrus] [skip circle]
-rw-r--r-- | numpy/core/fromnumeric.py | 5 | ||||
-rw-r--r-- | numpy/core/tests/test_numeric.py | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 6dfd95b96..7ea2313d1 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -3821,6 +3821,7 @@ def round_(a, decimals=0, out=None): -------- around : equivalent function; see for details. """ + # 2023-02-28, 1.25.0 warnings.warn("`round_` is deprecated as of NumPy 1.25.0, and will be " "removed in NumPy 2.0. Please use `round` instead.", DeprecationWarning, stacklevel=2) @@ -3840,6 +3841,7 @@ def product(*args, **kwargs): -------- prod : equivalent function; see for details. """ + # 2023-03-02, 1.25.0 warnings.warn("`product` is deprecated as of NumPy 1.25.0, and will be " "removed in NumPy 2.0. Please use `prod` instead.", DeprecationWarning, stacklevel=2) @@ -3859,6 +3861,7 @@ def cumproduct(*args, **kwargs): -------- cumprod : equivalent function; see for details. """ + # 2023-03-02, 1.25.0 warnings.warn("`cumproduct` is deprecated as of NumPy 1.25.0, and will be " "removed in NumPy 2.0. Please use `cumprod` instead.", DeprecationWarning, stacklevel=2) @@ -3880,6 +3883,7 @@ def sometrue(*args, **kwargs): -------- any : equivalent function; see for details. """ + # 2023-03-02, 1.25.0 warnings.warn("`sometrue` is deprecated as of NumPy 1.25.0, and will be " "removed in NumPy 2.0. Please use `any` instead.", DeprecationWarning, stacklevel=2) @@ -3899,6 +3903,7 @@ def alltrue(*args, **kwargs): -------- numpy.all : Equivalent function; see for details. """ + # 2023-03-02, 1.25.0 warnings.warn("`alltrue` is deprecated as of NumPy 1.25.0, and will be " "removed in NumPy 2.0. Please use `all` instead.", DeprecationWarning, stacklevel=2) diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py index d5a846b94..f81f563cd 100644 --- a/numpy/core/tests/test_numeric.py +++ b/numpy/core/tests/test_numeric.py @@ -115,7 +115,8 @@ class TestNonarrayArgs: def test_cumproduct(self): A = [[1, 2, 3], [4, 5, 6]] with assert_warns(DeprecationWarning): - assert_(np.all(np.cumproduct(A) == np.array([1, 2, 6, 24, 120, 720]))) + expected = np.array([1, 2, 6, 24, 120, 720]) + assert_(np.all(np.cumproduct(A) == expected)) def test_diagonal(self): a = [[0, 1, 2, 3], |