-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
ENH: Overhaul of NumPy lib
namespace [NEP 52]
#24507
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
Comments
@mtsokol - be careful - |
Hi @mhvk! Sure, that's correct. The ones from |
Yes, |
Focusing on what remains or becomes a public name would be useful. The checklist of what to make private is useful too, but that's more a todo list. I'd suggest going into more detail on what will be officially public. And then on what the TBDs are or potential pain points. If some current |
I am not sure, but I suspect that |
|
@rgommers Sure! I updated the PR's description. All "main ns" public items are in the agreed "keep" list, so main namespaces shouldn't shrink. I think it's only local namespaces that we will discuss then. |
Thanks Mateusz, that's a clear list. There really is very little in "local ns", so basically we're hiding almost everything that's there now and have more or less a clean slate to add new niche functionality that doesn't qualify for inclusion in the main namespace. That'll be quite nice, and has been on our wish list for a long time. Maybe add local ns items for |
It looks like there's still two minor usages of |
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 namespacenp
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.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
PRmain ns: N/A
local ns: NumpyVersion, Arrayterator, add_newdoc, add_docstring, tracemalloc_domain
array_utils
PRmain ns: N/A
local ns: byte_bounds, discover_array_parameters, normalize_axis_index, normalize_axis_tuple
histograms
PRmain ns: histogram, histogramdd, histogram_bin_edges
local ns:
type_check
PRmain ns: iscomplexobj, isrealobj, imag, iscomplex, isreal, nan_to_num, real, real_if_close, typename, mintypecode, common_type
local ns:
nanfunctions
PRmain ns: nansum, nanmax, nanmin, nanargmax, nanargmin, nanmean, nanmedian, nanpercentile, nanvar, nanstd, nanprod, nancumsum, nancumprod, nanquantile
local ns:
function_base
PRmain 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
PRmain 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
PRmain ns: pad
local ns:
arraysetops
PRmain ns: ediff1d, intersect1d, setxor1d, union1d, setdiff1d, unique, isin
local ns:
twodim_base
PRmain 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
PRmain ns: fix, isneginf, isposinf
local ns:
utils
PRmain ns: get_include, info, show_runtime
local ns:
npyio
PRmain ns: savetxt, loadtxt, genfromtxt, load, save, savez, savez_compressed, packbits, unpackbits, fromregex,
local ns: DataSource, NpzFile, BagObj
polynomial
PRmain ns: poly, roots, polyint, polyder, polyadd, polysub, polymul, polydiv, polyval, poly1d, polyfit
local ns:
stride_tricks
PRmain ns: broadcast_to, broadcast_arrays, broadcast_shapes
local ns: as_strided, sliding_window_view
index_tricks
PRmain 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 innp
.The text was updated successfully, but these errors were encountered: