8000 Merge pull request #24564 from mtsokol/revert-add-newdoc · numpy/numpy@ef0fd39 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef0fd39

Browse files
authored
Merge pull request #24564 from mtsokol/revert-add-newdoc
API: Readd `add_docstring` and `add_newdoc` to `np.lib` [skip azp] [skip cirrus] [skip circle]
2 parents 2e170ea + 6658e74 commit ef0fd39

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

numpy/_expired_attrs_2_0.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"NZERO": "Use `-0.0` instead.",
2121
"PZERO": "Use `0.0` instead.",
2222
"add_newdoc":
23-
"It's an internal function and doesn't have a replacement.",
23+
"It's still available as `np.lib.add_newdoc`.",
2424
"add_docstring":
25-
"It's an internal function and doesn't have a replacement.",
25+
"It's still available as `np.lib.add_docstring`.",
2626
"add_newdoc_ufunc":
2727
"It's an internal function and doesn't have a replacement.",
2828
"compat": "There's no replacement, as Python 2 is no longer supported.",

numpy/lib/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
from .arrayterator import Arrayterator
5151
from .arraypad import *
5252
from ._version import *
53-
from numpy.core._multiarray_umath import tracemalloc_domain
53+
from numpy.core._multiarray_umath import add_docstring, tracemalloc_domain
54+
from numpy.core.function_base import add_newdoc
5455

5556
__all__ = ['emath']
5657
__all__ += type_check.__all__

numpy/lib/__init__.pyi

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,14 @@ from numpy.lib.utils import (
156156
)
157157

158158
from numpy.core.multiarray import (
159+
add_docstring as add_docstring,
159160
tracemalloc_domain as tracemalloc_domain,
160161
)
161162

163+
from numpy.core.function_base import (
164+
add_newdoc as add_newdoc,
165+
)
166+
162167
__all__: list[str]
163168
__path__: list[str]
164169
test: PytestTester

numpy/lib/_function_base_impl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
)
2222
from numpy.core.numerictypes import typecodes
2323
from numpy.core import overrides
24-
from numpy.core.function_base import add_newdoc
2524
from numpy.lib.twodim_base import diag
2625
from numpy.core.multiarray import (
27-
_place, add_docstring, bincount, normalize_axis_index, _monotonicity,
26+
_place, bincount, normalize_axis_index, _monotonicity,
2827
interp as compiled_interp, interp_complex as compiled_interp_complex
2928
)
3029
from numpy._utils import set_module

numpy/lib/_function_base_impl.pyi

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ from numpy._typing import (
4848
_ComplexLike_co,
4949
)
5050

51-
from numpy.core.function_base import (
52-
add_newdoc as add_newdoc,
53-
)
54-
5551
from numpy.core.multiarray import (
56-
add_docstring as add_docstring,
5752
bincount as bincount,
5853
)
5954

0 commit comments

Comments
 (0)
0