You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is meant for monitoring and discussing cleanup of np.lib namespace. (Tracking parent issue: #23999)
Main goal is to make each public function, which lives in np.lib, available either from the main namespace np or "local lib" namespace e.g. np.lib.npyio. As a result, there will be only one way to access a specific public function in NumPy.
To achieve it, for each relevant lib submodule, there will be a private file (that starts with _) imported by the main namespace, and a public file that allows to be accessed as a public submodule.
# Example:np.broadcast_to# imported from numpy/lib/_stride_tricks.pynp.lib.stride_tricks.normalize_axis_tuple# imported from numpy/lib/stride_tricks.py
Let's call this mechanism "main or submodule namespace access". (maybe a better name?)
The scope of the milestone:
"ns" stands for "namespace". ☑️ means that this submodule has been refactored.
libPR
main ns: N/A
local ns: NumpyVersion, Arrayterator, add_newdoc, add_docstring, tracemalloc_domain
array_utilsPR
main ns: N/A
local ns: byte_bounds, discover_array_parameters, normalize_axis_index, normalize_axis_tuple
histogramsPR
main ns: histogram, histogramdd, histogram_bin_edges
local ns:
type_checkPR
main ns: iscomplexobj, isrealobj, imag, iscomplex, isreal, nan_to_num, real, real_if_close, typename, mintypecode, common_type
local ns:
nanfunctionsPR
main ns: nansum, nanmax, nanmin, nanargmax, nanargmin, nanmean, nanmedian, nanpercentile, nanvar, nanstd, nanprod, nancumsum, nancumprod, nanquantile
local ns:
Hi @rgommers @ngoldbaum,
This issue is meant for monitoring and discussing cleanup of
np.libnamespace. (Tracking parent issue: #23999)Main goal is to make each public function, which lives in
np.lib, available either from the main namespacenpor "local lib" namespace e.g.np.lib.npyio. As a result, there will be only one way to access a specific public function in NumPy.To achieve it, for each relevant
libsubmodule, there will be a private file (that starts with_) imported by the main namespace, and a public file that allows to be accessed as a public submodule.Let's call this mechanism "main or submodule namespace access". (maybe a better name?)
The scope of the milestone:
"ns" stands for "namespace". ☑️ means that this submodule has been refactored.
libPRmain ns: N/A
local ns: NumpyVersion, Arrayterator, add_newdoc, add_docstring, tracemalloc_domain
array_utilsPRmain ns: N/A
local ns: byte_bounds, discover_array_parameters, normalize_axis_index, normalize_axis_tuple
histogramsPRmain ns: histogram, histogramdd, histogram_bin_edges
local ns:
type_checkPRmain ns: iscomplexobj, isrealobj, imag, iscomplex, isreal, nan_to_num, real, real_if_close, typename, mintypecode, common_type
local ns:
nanfunctionsPRmain ns: nansum, nanmax, nanmin, nanargmax, nanargmin, nanmean, nanmedian, nanpercentile, nanvar, nanstd, nanprod, nancumsum, nancumprod, nanquantile
local ns:
function_basePRmain ns: select, piecewise, trim_zeros, copy, iterable, percentile, diff, gradient, angle, unwrap, sort_complex, flip, rot90, extract, place, vectorize, asarray_chkfinite, average, bincount, digitize, cov, corrcoef, median, sinc, hamming, hanning, bartlett, blackman, kaiser, i0, meshgrid, delete, insert, append, interp, quantile
local ns:
shape_basePRmain ns: column_stack, row_stack, dstack, array_split, split, hsplit, vsplit, dsplit, apply_over_axes, expand_dims, apply_along_axis, kron, tile, get_array_wrap, take_along_axis, put_along_axis
local ns:
arraypadPRmain ns: pad
local ns:
arraysetopsPRmain ns: ediff1d, intersect1d, setxor1d, union1d, setdiff1d, unique, isin
local ns:
twodim_basePRmain ns: diag, diagflat, eye, fliplr, flipud, tri, triu, tril, vander, histogram2d, mask_indices, tril_indices, tril_indices_from, triu_indices, triu_indices_from
local ns:
ufunclikePRmain ns: fix, isneginf, isposinf
local ns:
utilsPRmain ns: get_include, info, show_runtime
local ns:
npyioPRmain ns: savetxt, loadtxt, genfromtxt, load, save, savez, savez_compressed, packbits, unpackbits, fromregex,
local ns: DataSource, NpzFile, BagObj
polynomialPRmain ns: poly, roots, polyint, polyder, polyadd, polysub, polymul, polydiv, polyval, poly1d, polyfit
local ns:
stride_tricksPRmain ns: broadcast_to, broadcast_arrays, broadcast_shapes
local ns: as_strided, sliding_window_view
index_tricksPRmain ns: diag_indices_from, diag_indices, fill_diagonal, ndindex, ndenumerate, ix_, ogrid, mgrid, unravel_index, ravel_multi_index, s_, c_, r_, index_exp
local ns:
This work should be less disturbing than main namespace cleanup, as I think a function is rarely imported from
np.libif it's already available innp.