This tracking issue is meant to track the status and tasks of the Python API cleanup project for NumPy 2.0 (NEP 52, currently in draft status). Note: this is currently far from a complete plan, I wanted to make a start though at tracking things and making them actionable.
This issue is probably also a good place to suggest additional APIs to move/remove/deprecate, or other open issues that are related and can be tackled.
As a way of working, it'd be good to check usages of the function/object one is working on in downstream libraries (SciPy, scikit-learn, pandas is a good start), clean those up, then remove the object in question from the API. That has at least two benefits:
- it avoids CI in those projects to start failing when the change lands in a NumPy nightly,
- it gives a good sense of how easy it is to replace the usage with the recommended replacement
Cleaning up the main namespace
Cleaning up the submodule structure
Reducing the number of ways to select dtypes
Actionable:
Cleaning up the niche methods on numpy.ndarray
There are the ones listed in the NEP right now
Doing the above ones will give a better idea about the amount of effort involved, and may help with then identifying a next set.
Documentation
This tracking issue is meant to track the status and tasks of the Python API cleanup project for NumPy 2.0 (NEP 52, currently in draft status). Note: this is currently far from a complete plan, I wanted to make a start though at tracking things and making them actionable.
This issue is probably also a good place to suggest additional APIs to move/remove/deprecate, or other open issues that are related and can be tackled.
As a way of working, it'd be good to check usages of the function/object one is working on in downstream libraries (SciPy, scikit-learn, pandas is a good start), clean those up, then remove the object in question from the API. That has at least two benefits:
Cleaning up the main namespace
np.infandnp.nanaliasesnp.compat: API: deprecate compat and selected lib utils #23830Cleaning up the submodule structure
numpy.lib: ENH: Overhaul of NumPylibnamespace [NEP 52] #24507Reducing the number of ways to select dtypes
Actionable:
np.isdtypesctypeDictgenerate a deprecation warning. We cannot completely remove it because jax does this. See DEP: Deprecate registering dtype names with np.sctypeDict? #24699.sctyperelated things (see ENH: add a canonical way to determine if dtype is integer, floating point or complex #17325 (comment))issubsctype,sctypeDict& co from SciPy, pandas (both have a few occurrences) and perhaps a few other large downstream librariesCleaning up the niche methods on
numpy.ndarrayThere are the ones listed in the NEP right now
.setitem.newbyteorder.ptpDoing the above ones will give a better idea about the amount of effort involved, and may help with then identifying a next set.
Documentation
ruffby @mtsokol.. legacy::Sphinx directive - in progress: DOC: Add legacy directive to mark outdated objects #24939.. legacy::directive