Skip to content

Conversation

@JuliaPoo
Copy link
Contributor

See #14670.

When assume_unique=True, setxor1d attemptes to concatenate arrays with potentially incompatible dimensions. The fix implemented here calls np.ravel on the input arrays. The choice to call np.ravel instead of enforcing that the input arrays are 1D comes from the consensus in the linked issue to avoid breaking existing code.

See numpy#14670. Previously, when `assume_unique=True`, `setxor1d` attemptes
to concatenate arrays with potentially incompatible dimensions.
The choice to call `np.ravel` instead of enforcing that the input
arrays are 1D stems from the consensus in the linked issue to avoid
breaking existing code.
@JuliaPoo JuliaPoo force-pushed the issue-14670-setxor1d-docs branch from f339e74 to 6ca3e7d Compare May 28, 2024 08:20
Copy link
Member

@seberg seberg left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM, although I don't think there is need for a doc change and we can possibly simplify it even more.

To some degree the new tests are the important thing :). I wouldn't mind creating a new function for them (it is often nice to have smaller chunks if a test fails).

@JuliaPoo
Copy link
Contributor Author

Okie, I've modified the PR to your comments.

@mattip mattip merged commit 4ea21f3 into numpy:main May 29, 2024
@mattip
Copy link
Member

mattip commented May 29, 2024

Thanks @JuliaPoo

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants