8000 API: Readd `add_docstring` and `add_newdoc` to `np.lib` by mtsokol · Pull Request #24564 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

API: Readd add_docstring and add_newdoc to np.lib #24564

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 28, 2023
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
8000 Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions numpy/_expired_attrs_2_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"NZERO": "Use `-0.0` instead.",
"PZERO": "Use `0.0` instead.",
"add_newdoc":
"It's an internal function and doesn't have a replacement.",
"It's still available as `np.lib.add_newdoc`.",
"add_docstring":
"It's an internal function and doesn't have a replacement.",
"It's still available as `np.lib.add_docstring`.",
"add_newdoc_ufunc":
"It's an internal function and doesn't have a replacement.",
"compat": "There's no replacement, as Python 2 is no longer supported.",
Expand Down
3 changes: 2 additions & 1 deletion numpy/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
from .arrayterator import Arrayterator
from .arraypad import *
from ._version import *
from numpy.core._multiarray_umath import tracemalloc_domain
from numpy.core._multiarray_umath import add_docstring, tracemalloc_domain
from numpy.core.function_base import add_newdoc

__all__ = ['emath']
__all__ += type_check.__all__
Expand Down
5 changes: 5 additions & 0 deletions numpy/lib/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,14 @@ from numpy.lib.utils import (
)

from numpy.core.multiarray import (
add_docstring as add_docstring,
tracemalloc_domain as tracemalloc_domain,
)

from numpy.core.function_base import (
add_newdoc as add_newdoc,
)

__all__: list[str]
__path__: list[str]
test: PytestTester
Expand Down
3 changes: 1 addition & 2 deletions numpy/lib/_function_base_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
)
from numpy.core.numerictypes import typecodes
from numpy.core import overrides
from numpy.core.function_base import add_newdoc
from numpy.lib.twodim_base import diag
from numpy.core.multiarray import (
_place, add_docstring, bincount, normalize_axis_index, _monotonicity,
_place, bincount, normalize_axis_index, _monotonicity,
interp as compiled_interp, interp_complex as compiled_interp_complex
)
from numpy._utils import set_module
Expand Down
5 changes: 0 additions & 5 deletions numpy/lib/_function_base_impl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,7 @@ from numpy._typing import (
_ComplexLike_co,
)

from numpy.core.function_base import (
add_newdoc as add_newdoc,
)

from numpy.core.multiarray import (
add_docstring as add_docstring,
bincount as bincount,
)

Expand Down
0