Skip to content

BUG: add sorted=False to unique_all, unique_counts, unique_inverse#31244

Open
Jah-yee wants to merge 1 commit intonumpy:mainfrom
Jah-yee:fix/unique-sorted-param
Open

BUG: add sorted=False to unique_all, unique_counts, unique_inverse#31244
Jah-yee wants to merge 1 commit intonumpy:mainfrom
Jah-yee:fix/unique-sorted-param

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 14, 2026

Good day,

The docstrings claim equivalence to np.unique(..., sorted=False), but the source was missing the sorted=False parameter. This fix adds it to unique_all, unique_counts, and unique_inverse to match unique_values, which was fixed in NumPy 2.3.

See: /issues/31241

Thank you for your work on this project. I hope this small fix is helpful. Please let me know if there's anything to adjust.

Warmly, RoomWithOutRoof

The docstrings claim equivalence to np.unique(..., sorted=False), but the source
was missing sorted=False parameter. Added to match unique_values which
was fixed in NumPy 2.3.

See: numpy/issues/31241
@jorenham jorenham changed the title FIX: add sorted=False to unique_all, unique_counts, unique_inverse BUG: add sorted=False to unique_all, unique_counts, unique_inverse Apr 14, 2026
@ngoldbaum
Copy link
Copy Markdown
Member

The linter failure is unrelated to this PR.

That said, it'd be nice to have tests that demonstrate that these keywords are being passed. It looks like none of our existing tests demonstrate that and that means this could regress again in the future.

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.

3 participants