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

Skip to content

Commit 89a6f3e

Browse files
authored
API: Update lib.histograms namespace (#24513)
[skip ci]
1 parent c2051fd commit 89a6f3e

File tree

9 files changed

+11
-16
lines changed

9 files changed

+11
-16
lines changed

numpy/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@
195195
diag_indices_from, diagflat, diff, digitize, dsplit, dstack,
196196
ediff1d, emath, expand_dims, extract, eye, fill_diagonal, fix,
197197
flip, fliplr, flipud, fromregex, get_array_wrap, genfromtxt,
198-
get_include, gradient, hamming, hanning, histogram, histogram2d,
199-
histogram_bin_edges, histogramdd, hsplit, i0, imag, in1d,
198+
get_include, gradient, hamming, hanning, histogram2d,
199+
hsplit, i0, imag, in1d,
200200
index_exp, info, insert, interp, intersect1d, iscomplex,
201201
iscomplexobj, isin, isneginf, isreal, isrealobj, issubclass_,
202202
issubsctype, iterable, ix_, kaiser, kron, load, loadtxt, mask_indices,
@@ -215,6 +215,9 @@
215215
triu, triu_indices, triu_indices_from, isposinf, disp,
216216
deprecate, deprecate_with_doc, safe_eval, recfromtxt, recfromcsv
217217
)
218+
from .lib._histograms_impl import (
219+
histogram, histogram_bin_edges, histogramdd
220+
)
218221
from . import matrixlib as _mat
219222
from .matrixlib import (
220223
asmatrix, bmat, mat, matrix
@@ -275,7 +278,8 @@
275278

276279
__all__ = list(
277280
__numpy_submodules__ | set(core.__all__) | set(lib.__all__) |
278-
set(_mat.__all__) | {"show_config", "__version__"}
281+
set(_mat.__all__) | set(lib._histograms_impl.__all__) |
282+
{"show_config", "__version__"}
279283
)
280284

281285
# Filter out Cython harmless warnings

numpy/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ from numpy.lib.function_base import (
469469
quantile as quantile,
470470
)
471471

472-
from numpy.lib.histograms import (
472+
from numpy.lib._histograms_impl import (
473473
histogram_bin_edges as histogram_bin_edges,
474474
histogram as histogram,
475475
histogramdd as histogramdd,

numpy/lib/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from . import stride_tricks
2828
from . import twodim_base
2929
from . import ufunclike
30-
from . import histograms
30+
from . import _histograms_impl
3131
from . import polynomial
3232
from . import utils
3333
from . import arraysetops
@@ -44,7 +44,6 @@
4444
from .stride_tricks import *
4545
from .twodim_base import *
4646
from .ufunclike import *
47-
from .histograms import *
4847

4948
from .polynomial import *
5049
from .utils import *
@@ -71,7 +70,6 @@
7170
__all__ += arraysetops.__all__
7271
__all__ += npyio.__all__
7372
__all__ += nanfunctions.__all__
74-
__all__ += histograms.__all__
7573

7674
from numpy._pytesttester import PytestTester
7775
test = PytestTester(__name__)

numpy/lib/__init__.pyi

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ from numpy.lib.function_base import (
8383
quantile as quantile,
8484
)
8585

86-
from numpy.lib.histograms import (
87-
histogram_bin_edges as histogram_bin_edges,
88-
histogram as histogram,
89-
histogramdd as histogramdd,
90-
)
91-
9286
from numpy.lib.index_tricks import (
9387
ravel_multi_index as ravel_multi_index,
9488
unravel_index as unravel_index,
File renamed without changes.
File renamed without changes.

numpy/lib/function_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from numpy._utils import set_module
3131

3232
# needed in this module for compatibility
33-
from numpy.lib.histograms import histogram, histogramdd # noqa: F401
33+
from numpy.lib._histograms_impl import histogram, histogramdd # noqa: F401
3434

3535

3636
array_function_dispatch = functools.partial(

numpy/lib/tests/test_histograms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22

3-
from numpy.lib.histograms import histogram, histogramdd, histogram_bin_edges
3+
from numpy import histogram, histogramdd, histogram_bin_edges
44
from numpy.testing import (
55
assert_, assert_equal, assert_array_equal, assert_almost_equal,
66
assert_array_almost_equal, assert_raises, assert_allclose,

numpy/tests/test_public_api.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ def test_NPY_NO_EXPORT():
207207
"lib.arraysetops",
208208
"lib.arrayterator",
209209
"lib.function_base",
210-
"lib.histograms",
211210
"lib.index_tricks",
212211
"lib.nanfunctions",
213212
"lib.npyio",

0 commit comments

Comments
 (0)