-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Description
Hi @rgommers @ngoldbaum,
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.py
np.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.
-
lib
PR
main ns: N/A
local ns: NumpyVersion, Arrayterator, add_newdoc, add_docstring, tracemalloc_domain -
array_utils
PR
main ns: N/A
local ns: byte_bounds, discover_array_parameters, normalize_axis_index, normalize_axis_tuple -
histograms
PR
main ns: histogram, histogramdd, histogram_bin_edges
local ns: -
type_check
PR
main ns: iscomplexobj, isrealobj, imag, iscomplex, isreal, nan_to_num, real, real_if_close, typename, mintypecode, common_type
local ns: -
nanfunctions
PR
main ns: nansum, nanmax, nanmin, nanargmax, nanargmin, nanmean, nanmedian, nanpercentile, nanvar, nanstd, nanprod, nancumsum, nancumprod, nanquantile
local ns: -
function_base
PR
main 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_base
PR
main 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: -
arraypad
PR
main ns: pad
local ns: -
arraysetops
PR
main ns: ediff1d, intersect1d, setxor1d, union1d, setdiff1d, unique, isin
local ns: -
twodim_base
PR
main 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: -
ufunclike
PR
main ns: fix, isneginf, isposinf
local ns: -
utils
PR
main ns: get_include, info, show_runtime
local ns: -
npyio
PR
main ns: savetxt, loadtxt, genfromtxt, load, save, savez, savez_compressed, packbits, unpackbits, fromregex,
local ns: DataSource, NpzFile, BagObj -
polynomial
PR
main ns: poly, roots, polyint, polyder, polyadd, polysub, polymul, polydiv, polyval, poly1d, polyfit
local ns: -
stride_tricks
PR
main ns: broadcast_to, broadcast_arrays, broadcast_shapes
local ns: as_strided, sliding_window_view -
index_tricks
PR
main 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.lib
if it's already available in np
.