Skip to content

API: Add cross to numpy.linalg [Array API]#25145

Merged
ngoldbaum merged 1 commit into
numpy:mainfrom
mtsokol:array-api-cross
Dec 5, 2023
Merged

API: Add cross to numpy.linalg [Array API]#25145
ngoldbaum merged 1 commit into
numpy:mainfrom
mtsokol:array-api-cross

Conversation

@mtsokol

@mtsokol mtsokol commented Nov 14, 2023

Copy link
Copy Markdown
Member

This PR contains next Array API compatibility change. It adds numpy.linalg.cross (almost the same as numpy.cross) with docs taken from Array API specification.

@mtsokol mtsokol added this to the 2.0.0 release milestone Dec 4, 2023
@ngoldbaum

Copy link
Copy Markdown
Member

This looks good to me. xref #13718 for a little context.

It also looks like we've already deprecated the 2D cross product behavior:

In [2]: np.cross([1, 2], [2, 1])
<ipython-input-2-eec728c54e9b>:1: DeprecationWarning: Arrays of 2-dimensional vectors are deprecated. Use arrays of 3-dimensional vectors instead. (deprecated in NumPy 2.0)
  np.cross([1, 2], [2, 1])
Out[2]: array(-3)

In it goes. Thanks @mtsokol!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants