Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ff5dce9

Browse files
authored
Merge pull request #24577 from mtsokol/lib-twodimbase-namespace
API: Update `lib.twodim_base` namespace
2 parents 0239d3e + 932edf6 commit ff5dce9

File tree

10 files changed

+20
-38
lines changed

10 files changed

+20
-38
lines changed

numpy/__init__.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,22 +185,20 @@
185185
from .lib import (
186186
DataSource, apply_along_axis, apply_over_axes,
187187
array_split, broadcast_arrays, broadcast_shapes,
188-
broadcast_to, byte_bounds, c_, column_stack, diag, diag_indices,
189-
diag_indices_from, diagflat, dsplit, dstack,
190-
ediff1d, emath, expand_dims, eye, fill_diagonal, fix,
191-
fliplr, flipud, fromregex, get_array_wrap, genfromtxt,
192-
get_include, histogram2d, hsplit, in1d, index_exp, info, intersect1d,
193-
isin, isneginf, ix_, kron, load, loadtxt, mask_indices,
188+
broadcast_to, byte_bounds, c_, column_stack, diag_indices,
189+
diag_indices_from, dsplit, dstack,
190+
ediff1d, emath, expand_dims, fill_diagonal, fix,
191+
fromregex, get_array_wrap, genfromtxt,
192+
get_include, hsplit, in1d, index_exp, info, intersect1d,
193+
isin, isneginf, ix_, kron, load, loadtxt,
194194
mgrid, ndenumerate, ndindex, ogrid,
195195
packbits, pad, poly, poly1d, polyadd, polyder,
196196
polydiv, polyfit, polyint, polymul, polysub, polyval,
197197
put_along_axis, r_, ravel_multi_index,
198198
roots, row_stack, s_, save, savetxt, savez, savez_compressed,
199199
setdiff1d, setxor1d, show_runtime, split,
200-
take_along_axis, tile, tri, tril,
201-
tril_indices, tril_indices_from, union1d, unique, unpackbits,
202-
unravel_index, vander, vsplit, triu, triu_indices, triu_indices_from,
203-
isposinf
200+
take_along_axis, tile, union1d, unique, unpackbits,
201+
unravel_index, vsplit, isposinf
204202
)
205203
from .lib._histograms_impl import (
206204
histogram, histogram_bin_edges, histogramdd
@@ -217,6 +215,11 @@
217215
corrcoef, median, sinc, hamming, hanning, bartlett, blackman,
218216
kaiser, trapz, i0, meshgrid, delete, insert, append, interp, quantile
219217
)
218+
from .lib._twodim_base_impl import (
219+
diag, diagflat, eye, fliplr, flipud, tri, triu, tril, vander,
220+
histogram2d, mask_indices, tril_indices, tril_indices_from,
221+
triu_indices, triu_indices_from
222+
)
220223
from .lib._type_check_impl import (
221224
iscomplexobj, isrealobj, imag, iscomplex, isreal, nan_to_num, real,
222225
real_if_close, typename, mintypecode, common_type
@@ -284,6 +287,7 @@
284287
set(_mat.__all__) | set(lib._histograms_impl.__all__) |
285288
set(lib._nanfunctions_impl.__all__) |
286289
set(lib._function_base_impl.__all__) |
290+
set(lib._twodim_base_impl.__all__) |
287291
set(lib._type_check_impl.__all__) |
288292
{"show_config", "__version__"}
289293
)

numpy/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ from numpy.lib.stride_tricks import (
543543
broadcast_shapes as broadcast_shapes,
544544
)
545545

546-
from numpy.lib.twodim_base import (
546+
from numpy.lib._twodim_base_impl import (
547547
diag as diag,
548548
diagflat as diagflat,
549549
eye as eye,

numpy/lib/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from . import _function_base_impl
2626
from . import shape_base
2727
from . import stride_tricks
28-
from . import twodim_base
28+
from . import _twodim_base_impl
2929
from . import ufunclike
3030
from . import _histograms_impl
3131
from . import polynomial
@@ -39,7 +39,6 @@
3939
from .index_tricks import *
4040
from .shape_base import *
4141
from .stride_tricks import *
42-
from .twodim_base import *
4342
from .ufunclike import *
4443

4544
from .polynomial import *
@@ -57,7 +56,6 @@
5756
__all__ += index_tricks.__all__
5857
__all__ += shape_base.__all__
5958
__all__ += stride_tricks.__all__
60-
__all__ += twodim_base.__all__
6159
__all__ += ufunclike.__all__
6260
__all__ += arraypad.__all__
6361
__all__ += polynomial.__all__

numpy/lib/__init__.pyi

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -110,24 +110,6 @@ from numpy.lib.stride_tricks import (
110110
broadcast_shapes as broadcast_shapes,
111111
)
112112

113-
from numpy.lib.twodim_base import (
114-
diag as diag,
115-
diagflat as diagflat,
116-
eye as eye,
117-
fliplr as fliplr,
118-
flipud as flipud,
119-
tri as tri,
120-
triu as triu,
121-
tril as tril,
122-
vander as vander,
123-
histogram2d as histogram2d,
124-
mask_indices as mask_indices,
125-
tril_indices as tril_indices,
126-
tril_indices_from as tril_indices_from,
127-
triu_indices as triu_indices,
128-
triu_indices_from as triu_indices_from,
129-
)
130-
131113
from numpy.lib.ufunclike import (
132114
fix as fix,
133115
isposinf as isposinf,

numpy/lib/_function_base_impl.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import numpy as np
99
import numpy.core.numeric as _nx
10-
from numpy.core import transpose
10+
from numpy.core import transpose, overrides
1111
from numpy.core.numeric import (
1212
ones, zeros_like, arange, concatenate, array, asarray, asanyarray, empty,
1313
ndarray, take, dot, where, intp, integer, isscalar, absolute
@@ -20,8 +20,7 @@
2020
ravel, nonzero, partition, mean, any, sum
2121
)
2222
from numpy.core.numerictypes import typecodes
23-
from numpy.core import overrides
24-
from numpy.lib.twodim_base import diag
23+
from numpy.lib._twodim_base_impl import diag
2524
from numpy.core.multiarray import (
2625
_place, bincount, normalize_axis_index, _monotonicity,
2726
interp as compiled_interp, interp_complex as compiled_interp_complex
File renamed without changes.
File renamed without changes.

numpy/lib/polynomial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ones)
1818
from numpy.core import overrides
1919
from numpy.exceptions import RankWarning
20-
from numpy.lib.twodim_base import diag, vander
20+
from numpy.lib._twodim_base_impl import diag, vander
2121
from numpy.lib._function_base_impl import trim_zeros
2222
from numpy.lib._type_check_impl import iscomplex, real, imag, mintypecode
2323
from numpy.linalg import eigvals, lstsq, inv

numpy/linalg/linalg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
)
3232
from numpy.core.multiarray import normalize_axis_index
3333
from numpy.core import overrides
34-
from numpy.lib.twodim_base import triu, eye
34+
from numpy.lib._twodim_base_impl import triu, eye
3535
from numpy.linalg import _umath_linalg
3636

3737
from numpy._typing import NDArray

numpy/tests/test_public_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ def test_NPY_NO_EXPORT():
203203
"lib.npyio",
204204
"lib.polynomial",
205205
"lib.shape_base",
206-
"lib.twodim_base",
207206
"lib.ufunclike",
208207
"lib.user_array", # note: not in np.lib, but probably should just be deleted
209208
"lib.utils",

0 commit comments

Comments
 (0)