Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/release/upcoming_changes/30612.expired.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* The ``numpy.lib.math`` alias for the standard library ``math`` module has been removed (deprecated since 1.25).
5 changes: 0 additions & 5 deletions numpy/_core/tests/test_deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,6 @@ def test_attributeerror_includes_info(self, name):
getattr(np, name)


class TestMathAlias(_DeprecationTestCase):
def test_deprecated_np_lib_math(self):
self.assert_deprecated(lambda: np.lib.math)


class TestDeprecatedDTypeAliases(_DeprecationTestCase):

def _check_for_warning(self, func):
Expand Down
9 changes: 1 addition & 8 deletions numpy/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,9 @@

def __getattr__(attr):
# Warn for deprecated/removed aliases
import math
import warnings

if attr == "math":
warnings.warn(
"`np.lib.math` is a deprecated alias for the standard library "
"`math` module (Deprecated Numpy 1.25). Replace usages of "
"`numpy.lib.math` with `math`", DeprecationWarning, stacklevel=2)
return math
elif attr == "emath":
if attr == "emath":
raise AttributeError(
"numpy.lib.emath was an alias for emath module that was removed "
"in NumPy 2.0. Replace usages of numpy.lib.emath with "
Expand Down
1 change: 0 additions & 1 deletion numpy/tests/test_public_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ def test_all_modules_are_expected():
# Stuff that clearly shouldn't be in the API and is detected by the next test
# below
SKIP_LIST_2 = [
'numpy.lib.math',
'numpy.matlib.char',
'numpy.matlib.rec',
'numpy.matlib.emath',
Expand Down
Loading