diff options
author | Ralf Gommers <ralf.gommers@gmail.com> | 2023-03-02 14:57:43 +0000 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@gmail.com> | 2023-03-02 15:10:41 +0000 |
commit | 9990f98f2e9e1a55f5d42206cbc6709a3efff418 (patch) | |
tree | fa0e6498a52287320c5a66ffe413dc8fd733171d /numpy/core/fromnumeric.py | |
parent | 6a819d660afddaf3e9fba6de00f8f4d366813a5c (diff) | |
download | numpy-9990f98f2e9e1a55f5d42206cbc6709a3efff418.tar.gz |
DEP: deprecate `product`, `cumproduct`, `sometrue`, `alltrue`
[skip cirrus]
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index ed8b68ecd..6dfd95b96 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -3832,10 +3832,17 @@ def product(*args, **kwargs): """ Return the product of array elements over a given axis. + .. deprecated:: 1.25.0 + ``product`` is deprecated as of NumPy 1.25.0, and will be + removed in NumPy 2.0. Please use `prod` instead. + See Also -------- prod : equivalent function; see for details. """ + 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) return prod(*args, **kwargs) @@ -3844,10 +3851,17 @@ def cumproduct(*args, **kwargs): """ Return the cumulative product over the given axis. + .. deprecated:: 1.25.0 + ``cumproduct`` is deprecated as of NumPy 1.25.0, and will be + removed in NumPy 2.0. Please use `cumprod` instead. + See Also -------- cumprod : equivalent function; see for details. """ + 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) return cumprod(*args, **kwargs) @@ -3858,10 +3872,17 @@ def sometrue(*args, **kwargs): Refer to `any` for full documentation. + .. deprecated:: 1.25.0 + ``sometrue`` is deprecated as of NumPy 1.25.0, and will be + removed in NumPy 2.0. Please use `any` instead. + See Also -------- any : equivalent function; see for details. """ + 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) return any(*args, **kwargs) @@ -3870,8 +3891,15 @@ def alltrue(*args, **kwargs): """ Check if all elements of input array are true. + .. deprecated:: 1.25.0 + ``alltrue`` is deprecated as of NumPy 1.25.0, and will be + removed in NumPy 2.0. Please use `all` instead. + See Also -------- numpy.all : Equivalent function; see for details. """ + 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) return all(*args, **kwargs) |