-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
API: deprecate size-2 inputs for np.cross
[Array API]
#24818
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
Conversation
f609711
to
8e9af15
Compare
Hey Mateusz, good idea to get started on this topic.
Indeed. We want the
Yep, that's a good place to start. The other place to look at is https://numpy.org/devdocs/reference/array_api.html#table-of-differences-between-numpy-array-api-and-numpy; the "compatible" and "breaking" entries there are the things to add/change. |
d5b5cda
to
8664533
Compare
np.cross
np.cross
[Array API]
8664533
to
f2f9e8c
Compare
numpy/_core/numeric.py
Outdated
# Deprecated in NumPy 2.0, 2023-09-26 | ||
warnings.warn( | ||
"2-dimensional input arrays are deprecated. Use 3-dimensional " | ||
"instead. (deprecated in NumPy 2.0)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little confusing, since n-dimensional stacks of vectors are fine, the only thing that matters is if the final dimension is 2. Maybe rephrase this to talk about arrays of 2D and 3D vectors instead of just 2D or 3D arrays?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - I changed warning to:
"Arrays of 2-dimensional vectors are deprecated. Use arrays of "
"3-dimensional vectors instead. (deprecated in NumPy 2.0)"
7f6fc45
to
3f5dee9
Compare
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
3f5dee9
to
ea42abc
Compare
np.cross
[Array API]np.cross
[Array API]
Thanks @mtsokol! |
Hi @rgommers,
As NEP 52 comes closer to the end I decided to start a warmup for the next milestone. IIRC you mentioned I could potentially focus on "Array API support in NumPy" workstream.
From our conversation in July I noted such introductory tasks:
Some questions:
numpy.array_api
already has compatibletrace
anddiagonal
, but you meant adding these methods tonp.linalg
directly, right? (so duplicating a bitnp.trace
andnp.diagonal
)This small PR adds a deprecation to
np.cross
for 2-size input.