ENH: use native numpy.reshape for numpy>=2.1 - #454
Conversation
e339f3c to
3abfdbd
Compare
|
Development in this repository is human-first, and we very much prefer to not receive automated contributions from bots. |
|
@ev-br I am a human contributor. |
|
Than my apologies @stanbot8 . We receive too many automated pull requests and the default shifts to "shoot first ask later". And the combination of the GH username and the PR style was too LLM-like. So, could you then please explain (preferably in your human words, without using an LLM), what is this patch, what is the problem it aims to address and what is the solution? |
|
No worries @ev-br, I understand how my username and the PR style could have given that impression. I found this while testing the project with NumPy 2.5.1. The |
|
Oh I see what's going on here now, thank you! So the Now, using the native function instead of a pile of workarounds is definitely a win and is very worthy goal to work towards! I just quickly tried running tests with bare numpy 2.4.2 and a branch of data-apis/array-api-tests#432 and it passes: Therefore, how about:
For testing, I think it would be cleaner to test numpy and cupy instead of If you are feeling brave and have cycles to spare, help fixing data-apis/array-api-tests#432 would be appreciated but is certainly not a blocker for this PR. |
3abfdbd to
6a46752
Compare
|
Rewrote per your suggestion. The numpy version branch sends only an older numpy through the workaround, so the runtime |
|
CI errors seem unrelated. #456 is to fix the error with |
|
close/reopen to retrigger CI after gh-456 |
reshapewithcopy=Falseassigns to the array shape attribute that numpy 2.5 deprecates.Bind the numpy namespace
reshapeto the native numpy function from numpy 2.1. That release added the copy argument. Keep the shared workaround for an older numpy.Leave the cupy and dask paths unchanged. Neither namespace accepts a copy argument, so both still need the shared workaround.