-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
ENH: Descending sorts with built-in dtype implementations #31345
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
3adafe8
ENH: ArrayMethod sorting for built-in dtypes
MaanasArora 07e6894
REF: Remove unused template variable
MaanasArora 8a5df82
REF: Simplify output descriptor in sort_resolve_descriptors
MaanasArora 923116f
BUG: Move builtin sort registrations after array method types are ready
MaanasArora 241ba4b
REF: Remove set_sorts function back to set_typeinfo, move ready array…
MaanasArora 63787e6
Descending sorting with built-in dtype implementations
MaanasArora ce87f1e
REF: Fix linting
MaanasArora 5e0f399
Register new-style sorts in C++, templated compare used in sorts
MaanasArora 7e36287
Move generic templated sorts to header files
MaanasArora 0dadfee
Fix string/unicode sorting
MaanasArora 83f4e76
Use ordered initialization for sort and argsort specs
MaanasArora 71b7154
Amend sorting ArrFuncs
MaanasArora 1c95a4e
Fix linting and stubs issues
MaanasArora e54fa74
Add randomization option and strings to descending sort tests
MaanasArora 451dcb1
Add descending option to argsort function signatures
MaanasArora 558183a
Add descending option to sort function signatures in fromnumeric and …
MaanasArora 87a3ea1
Add missing descending args in masked array sorts
MaanasArora 6ed868f
Add argsort descending tests
MaanasArora b586fdb
Refactor argsort return statement
MaanasArora ab43ee7
Add descending parameter to sort docs
MaanasArora 2f203b3
Change descending parameter in argsort to be optional
MaanasArora 6460b64
TST: Throw if stable/descending=True used with masked arrays
MaanasArora 9e6ff64
Fix signature issue (wasm) and use greater + npy::cmp helper (not sur…
seberg d84a54b
Restore ascending SIMD sorts
MaanasArora cfcc498
Refactor sorting functions to use type aliasing for dispatch types
MaanasArora 1e0a9a9
Fix quicksort dispatch to support np::half
MaanasArora f35b010
Add release note
MaanasArora 5cf942d
condition half typename for simd sorts on tag
MaanasArora 579c416
Apply complex bug fix suggestion
MaanasArora 70b4b72
Move sorting registration for all dtypes at once to C++
MaanasArora 4e85e7a
Descending sort tests for complex
MaanasArora 3948bd6
Fix complex tag greater to handle NaN cases correctly
MaanasArora f09471d
Replace sort dispatch flags on tag with constexpr check in quicksort_…
MaanasArora 51207b3
Swap names of quicksort and timsort generic and templated files
MaanasArora c1ec4b1
Better test for nan ordering in complex sorting (not lex ordering on …
MaanasArora a230d12
Refactor sorting tests; add lex order test for complex sorting
MaanasArora a8eed2a
Fix NaN handling in (arg)sorting tests
MaanasArora 3e5a8b7
Fix linting issues
MaanasArora 35e2a8f
Fix comparison of datetime and timedelta types in argsort test
MaanasArora 2e44d63
Fix SIMD dispatch (tag checking was broken)
MaanasArora 29890fe
Fix missing newline at end of file in npysort_methods.cpp
MaanasArora c486a18
fix heapsort dispatching in PyArray_(Arg)Sort (clear to quicksort for…
MaanasArora 4b3a481
Restore radixsort for ascending sorts
MaanasArora ffbc51c
Enable SIMD path for descending sorts on highway only
MaanasArora a654904
Fix compilation errors
MaanasArora 3f695ff
Fix missing argument (descending)
MaanasArora 99aa4d8
EXPERIMENT: Do not fallback to generic quicksort from highway
MaanasArora ad917a4
Guard highway include with VQSORT_ENABLED
MaanasArora fe35d68
Fill sort arrfunc with radixsort trampoline if using
MaanasArora e0e8d65
Fixup radixsort templating (may be unused) and QSort fallback logic
seberg 52970f7
Make error handling GIL safe (effectively unreachable anyway...)
seberg 92945ce
Use constexpr rather than finline (reformats complex slightly)
seberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix missing newline at end of file in npysort_methods.cpp
- Loading branch information
commit 29890fe241a866cfa2c3c83f4c1375dfda646cf9
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -313,4 +313,4 @@ int register_all_sorts() { | |
| r += make_sorts_<npy::half_tag>(&PyArray_HalfDType, "half"); | ||
|
|
||
| return r; | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hmmm, we don't have error handling on the other side now. (Although, it probably doesn't matter much, if this fails some Python error will bubble up and that is all that matters. -- it may be slightly nicer to deal with the errors right away, with a && chain or just a loop, although that may need making some local struct array to loop.)
Uh oh!
There was an error while loading. Please reload this page.
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.
Ah right - I made a suggestion in another comment, though yeah, not sure if it's much better given it's not chained!