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

Skip to content

API: Update lib.twodim_base namespace #24577

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 29, 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions numpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,22 +185,20 @@
from .lib import (
DataSource, apply_along_axis, apply_over_axes,
array_split, broadcast_arrays, broadcast_shapes,
broadcast_to, byte_bounds, c_, column_stack, diag, diag_indices,
diag_indices_from, diagflat, dsplit, dstack,
ediff1d, emath, expand_dims, eye, fill_diagonal, fix,
fliplr, flipud, fromregex, get_array_wrap, genfromtxt,
get_include, histogram2d, hsplit, in1d, index_exp, info, intersect1d,
isin, isneginf, ix_, kron, load, loadtxt, mask_indices,
broadcast_to, byte_bounds, c_, column_stack, diag_indices,
diag_indices_from, dsplit, dstack,
ediff1d, emath, expand_dims, fill_diagonal, fix,
fromregex, get_array_wrap, genfromtxt,
get_include, hsplit, in1d, index_exp, info, intersect1d,
isin, isneginf, ix_, kron, load, loadtxt,
mgrid, ndenumerate, ndindex, ogrid,
packbits, pad, poly, poly1d, polyadd, polyder,
polydiv, polyfit, polyint, polymul, polysub, polyval,
put_along_axis, r_, ravel_multi_index,
roots, row_stack, s_, save, savetxt, savez, savez_compressed,
setdiff1d, setxor1d, show_runtime, split,
take_along_axis, tile, tri, tril,
tril_indices, tril_indices_from, union1d, unique, unpackbits,
unravel_index, vander, vsplit, triu, triu_indices, triu_indices_from,
isposinf
take_along_axis, tile, union1d, unique, unpackbits,
unravel_index, vsplit, isposinf
)
from .lib._histograms_impl import (
histogram, histogram_bin_edges, histogramdd
Expand All @@ -217,6 +215,11 @@
corrcoef, median, sinc, hamming, hanning, bartlett, blackman,
kaiser, trapz, i0, meshgrid, delete, insert, append, interp, quantile
)
from .lib._twodim_base_impl import (
diag, diagflat, eye, fliplr, flipud, tri, triu, tril, vander,
histogram2d, mask_indices, tril_indices, tril_indices_from,
triu_indices, triu_indices_from
)
from .lib._type_check_impl import (
iscomplexobj, isrealobj, imag, iscomplex, isreal, nan_to_num, real,
real_if_close, typename, mintypecode, common_type
Expand Down Expand Up @@ -284,6 +287,7 @@
set(_mat.__all__) | set(lib._histograms_impl.__all__) |
set(lib._nanfunctions_impl.__all__) |
set(lib._function_base_impl.__all__) |
set(lib._twodim_base_impl.__all__) |
set(lib._type_check_impl.__all__) |
{"show_config", "__version__"}
)
Expand Down
2 changes: 1 addition & 1 deletion numpy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ from numpy.lib.stride_tricks import (
broadcast_shapes as broadcast_shapes,
)

from numpy.lib.twodim_base import (
from numpy.lib._twodim_base_impl import (
diag as diag,
diagflat as diagflat,
eye as eye,
Expand Down
4 changes: 1 addition & 3 deletions numpy/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from . import _function_base_impl
from . import shape_base
from . import stride_tricks
from . import twodim_base
from . import _twodim_base_impl
from . import ufunclike
from . import _histograms_impl
from . import polynomial
Expand All @@ -39,7 +39,6 @@
from .index_tricks import *
from .shape_base import *
from .stride_tricks import *
from .twodim_base import *
from .ufunclike import *

from .polynomial import *
Expand All @@ -57,7 +56,6 @@
__all__ += index_tricks.__all__
__all__ += shape_base.__all__
__all__ += stride_tricks.__all__
__all__ += twodim_base.__all__
__all__ += ufunclike.__all__
__all__ += arraypad.__all__
__all__ += polynomial.__all__
Expand Down
18 changes: 0 additions & 18 deletions numpy/lib/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,6 @@ from numpy.lib.stride_tricks import (
broadcast_shapes as broadcast_shapes,
)

from numpy.lib.twodim_base import (
diag as diag,
diagflat as diagflat,
eye as eye,
fliplr as fliplr,
flipud as flipud,
tri as tri,
triu as triu,
tril as tril,
vander as vander,
histogram2d as histogram2d,
mask_indices as mask_indices,
tril_indices as tril_indices,
tril_indices_from as tril_indices_from,
triu_indices as triu_indices,
triu_indices_from as triu_indices_from,
)

from numpy.lib.ufunclike import (
fix as fix,
isposinf as isposinf,
Expand Down
5 changes: 2 additions & 3 deletions numpy/lib/_function_base_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import numpy as np
import numpy.core.numeric as _nx
from numpy.core import transpose
from numpy.core import transpose, overrides
from numpy.core.numeric import (
ones, zeros_like, arange, concatenate, array, asarray, asanyarray, empty,
ndarray, take, dot, where, intp, integer, isscalar, absolute
Expand All @@ -20,8 +20,7 @@
ravel, nonzero, partition, mean, any, sum
)
from numpy.core.numerictypes import typecodes
from numpy.core import overrides
from numpy.lib.twodim_base import diag
from numpy.lib._twodim_base_impl import diag
from numpy.core.multiarray import (
_place, bincount, normalize_axis_index, _monotonicity,
interp as compiled_interp, interp_complex as compiled_interp_complex
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion numpy/lib/polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ones)
from numpy.core import overrides
from numpy.exceptions import RankWarning
from numpy.lib.twodim_base import diag, vander
from numpy.lib._twodim_base_impl import diag, vander
from numpy.lib._function_base_impl import trim_zeros
from numpy.lib._type_check_impl import iscomplex, real, imag, mintypecode
from numpy.linalg import eigvals, lstsq, inv
Expand Down
2 changes: 1 addition & 1 deletion numpy/linalg/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
)
from numpy.core.multiarray import normalize_axis_index
from numpy.core import overrides
from numpy.lib.twodim_base import triu, eye
from numpy.lib._twodim_base_impl import triu, eye
from numpy.linalg import _umath_linalg

from numpy._typing import NDArray
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 @@ -203,7 +203,6 @@ def test_NPY_NO_EXPORT():
"lib.npyio",
"lib.polynomial",
"lib.shape_base",
"lib.twodim_base",
"lib.ufunclike",
"lib.user_array", # note: not in np.lib, but probably should just be deleted
"lib.utils",
Expand Down