Skip to content

Removed support for arrays of 2-dimensional vectors in dpnp.cross#2950

Merged
antonwolfy merged 6 commits into
masterfrom
drop-2d-vectors-in-cross
Jun 17, 2026
Merged

Removed support for arrays of 2-dimensional vectors in dpnp.cross#2950
antonwolfy merged 6 commits into
masterfrom
drop-2d-vectors-in-cross

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

NumPy 2.5 expires the deprecation of 2-dimensional vectors in numpy.cross: the function now requires (arrays of) 3-dimensional vectors and raises ValueError otherwise.

This PR brings dpnp.cross in line with that behavior.
Dpnp had already deprecated 2-D vectors in dpnp.cross back in 0.17.0 (via DeprecationWarning), so this removes the deprecated path entirely.

Note, dpnp.cross now rejects 2-D vectors unconditionally, including when running tests against NumPy < 2.5 (where numpy.cross still computes a 2-D result). This is an intentional.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@antonwolfy antonwolfy added this to the 0.21.0 release milestone Jun 16, 2026
@antonwolfy antonwolfy self-assigned this Jun 16, 2026
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/index.html

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev1=py313h509198e_10 ran successfully.
Passed: 1356
Failed: 4
Skipped: 16

@antonwolfy antonwolfy marked this pull request as ready for review June 16, 2026 20:37
@coveralls

coveralls commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

No base build to compare — drop-2d-vectors-in-cross into master

Comment thread dpnp/tests/test_product.py
@vlad-perevezentsev vlad-perevezentsev self-requested a review June 17, 2026 11:27

@vlad-perevezentsev vlad-perevezentsev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you @antonwolfy

@antonwolfy antonwolfy merged commit a733826 into master Jun 17, 2026
63 of 85 checks passed
@antonwolfy antonwolfy deleted the drop-2d-vectors-in-cross branch June 17, 2026 16:53
github-actions Bot added a commit that referenced this pull request Jun 17, 2026
)

NumPy 2.5 expires the deprecation of 2-dimensional vectors in
`numpy.cross`: the function now requires (arrays of) 3-dimensional
vectors and raises `ValueError` otherwise.

This PR brings `dpnp.cross` in line with that behavior.
Dpnp had already deprecated 2-D vectors in `dpnp.cross` back in 0.17.0
(via `DeprecationWarning`), so this removes the deprecated path
entirely.

Note, `dpnp.cross` now rejects 2-D vectors unconditionally, including
when running tests against `NumPy < 2.5` (where numpy.cross still
computes a 2-D result). This is an intentional. a733826
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants