NEP 50 adoption related improvements/followups #24856
Labels
62 - Python API
Changes or additions to the Python API. Mailing list should usually be notified.
Milestone
Please don't hesitate to edit this issue to expand/clarify/add/remove items
Adopting NEP 50 is the most important part of a NumPy 2.0 release opinion because it consists of larger changes that we cannot possibly via a warning/deprecation path. IMO it is also by far the most important part of the idea of being as compatible as possible with the array api.
gh-23912 contains the maybe largest piece to try and adopt NEP 50 by default. In the PR, I listed the main things to be addressed/thought about. But an issue is better for tracking.
Note that I don't think I can find solutions and push on these all by myself. So help is needed. I also think that these issues have too many moving parts and it is probably impossible to wait for having a fix for all (or even most!) before we push on with removing the "legacy" mode!
Because of that, I really need others to chime in.
np.can_cast(123, "int8")
currently assumes the default integer for the123
which results in an unexpected result.can_cast
. (I am not sure ifcan_cast
fixing is vital or not.np.add(1., 5.3, dtype=np.intp)
with cast checking (I do not consider this a big issue in practice.)setitem
).type(x) in (int, float, complex)
is probably an ok start in many cases:percentile
andquantile
work as expected.asanyarray()
but should behave ufunc-like w.r.t. to weak promotion:isclose()
(requiresasanyarray()
for indexing)uint8 > -1
currently does not work.legacy
modeThe main points above are that e.g.
can_cast
logic may require some thoughts, which makes this quite tough. Which also means that I cannot address all of these at once, there is just too many moving parts without pushing forwards with the main changes and others helping out, e.g. with vetting python functions to see what patterns will help us align them with NEP 50.Further issues, which are not as high priority and only indirectly related are that we will want to change some other things such as disabling promotion of strings with numbers.
The text was updated successfully, but these errors were encountered: