GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ENH: implement descending sorts for StringDType by ngoldbaum · Pull Request #32286 · numpy/numpy

Conversation

@ngoldbaum

@ngoldbaum ngoldbaum commented Aug 13, 2026

Copy link
Copy Markdown
Member

PR summary

This implements support for descending sorts, following #31431 and #31345

Pretty straightforward! Mostly this is wiring things up.

Ping @MaanasArora I'd appreciate your opinion here.

AI Disclosure

I used an AI to help with the test and review my code.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ngoldbaum
ENH: implement descending sorts for StringDType
e7577c8
@ngoldbaum
ngoldbaum requested a review from MaanasArora August 13, 2026 20:10
@ngoldbaum ngoldbaum added 01 - Enhancement component: numpy.strings String dtypes and functions labels Aug 13, 2026
MaanasArora
MaanasArora approved these changes Aug 13, 2026
View reviewed changes

@MaanasArora MaanasArora left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Thanks @ngoldbaum, looks good! I was half-hoping we could keep reusing the default loops and maybe expand the static_data field to contain two PyArray_CompareFuncs, but I'm not entirely sure how that could be designed (though, an array of two seems reasonable honestly). If you think that's too out of scope or better for follow-up, completely happy to put this in as-is, just let me know and I'll merge!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ngoldbaum
MAINT: refactor to pass descending via STATIC_DATA, update sfloat as …
7afa9ed
…well
@ngoldbaum

ngoldbaum commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

@MaanasArora thanks for the suggestion! I think this is simpler, let me know what you think.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ngoldbaum
DOC: add duplicate release note so this PR gets included
a9bfe48
ngoldbaum
ngoldbaum commented Aug 14, 2026
View reviewed changes
Comment thread doc/release/upcoming_changes/32286.improvement.rst

@ngoldbaum ngoldbaum Aug 14, 2026

Copy link
Copy Markdown
Member Author

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.

it turns out if you add a second release note with the same content as the first, towncrier generates a single entry that references both PRs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

MaanasArora reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
MaanasArora
MaanasArora reviewed Aug 14, 2026
View reviewed changes
Comment thread numpy/_core/src/common/npy_sort.c Outdated
switch (sort_params->flags) {
if (cmp == NULL) {
npy_gil_error(PyExc_ValueError,
"descending sort not supported for this DType");

@MaanasArora MaanasArora Aug 14, 2026

Copy link
Copy Markdown
Contributor

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.

Can this not be ascending too?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@MaanasArora

MaanasArora commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Thanks @ngoldbaum, yes this looks great! Just an error handling change inline.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ngoldbaum
MAINT: fix error message
b85a455
@MaanasArora

MaanasArora commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Thanks, LGTM now - will merge when CI passes!

ngoldbaum reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@MaanasArora
MaanasArora merged commit 8e56e85 into numpy:main Aug 14, 2026
91 checks passed

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@MaanasArora MaanasArora MaanasArora approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

01 - Enhancement component: numpy.strings String dtypes and functions

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ngoldbaum @MaanasArora
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.