Skip to content

Commit

Permalink
Apply review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsokol committed Aug 28, 2023
1 parent 8ce7e9e commit 35c133a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 0 additions & 1 deletion doc/source/reference/routines.set.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Boolean operations
.. autosummary::
:toctree: generated/

ediff1d
in1d
intersect1d
isin
Expand Down
12 changes: 11 additions & 1 deletion numpy/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,23 @@ def __getattr__(attr):
import math
import warnings

def _private_module_msg(module_name: str) -> str:
return (
f"`np.lib.{module_name}` is now private. Function that you're "
"looking for should be available from the main namespace `np.*`"
)

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 in (
"histograms", "type_check", "nanfunctions", "function_base",
"arraypad", "arraysetops", "ufunclike", "utils"
):
raise AttributeError(_private_module_msg(attr))
else:
raise AttributeError("module {!r} has no attribute "
"{!r}".format(__name__, attr))

0 comments on commit 35c133a

Please sign in to comment.