Skip to content

Commit

Permalink
MAINT: add dates/versions to deprecations, fix linter complaint
Browse files Browse the repository at this point in the history
[skip cirrus] [skip circle]
  • Loading branch information
rgommers committed Mar 2, 2023
1 parent 2f0bc34 commit 3dcc33a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions numpy/core/fromnumeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion numpy/core/tests/test_numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ def test_count_nonzero(self):
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],
Expand Down

0 comments on commit 3dcc33a

Please sign in to comment.