Skip to content

group_ordering implementation#216

Merged
flexatone merged 4 commits into
masterfrom
215/group-order
Jul 4, 2026
Merged

group_ordering implementation#216
flexatone merged 4 commits into
masterfrom
215/group-order

Conversation

@flexatone

Copy link
Copy Markdown
Contributor

No description provided.

@flexatone flexatone marked this pull request as ready for review July 4, 2026 18:12
@flexatone flexatone requested a review from Copilot July 4, 2026 18:12

Copilot AI 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.

Pull request overview

Adds a new group_ordering API to ArrayKit that computes a stable grouping permutation and CSR-style group offsets for dense intp codes, along with tests, exports, and a performance benchmark harness entry.

Changes:

  • Implemented group_ordering(codes, *, size=None) in the C extension and registered it in the module.
  • Added comprehensive unit tests covering correctness, validation, immutability, and parity vs NumPy stable argsort.
  • Added a performance benchmark entry for group_ordering and exported the API in Python + stubs.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/test_group_ordering.py New unit tests validating group_ordering behavior and edge cases.
src/methods.h Adds the C API declaration for group_ordering.
src/methods.c Implements group_ordering via stable counting sort producing perm + offsets.
src/_arraykit.c Registers group_ordering in the extension module method table.
src/init.pyi Adds typing stub for group_ordering.
src/init.py Re-exports group_ordering from the extension module.
performance/main.py Adds group_ordering benchmark classes (AK vs REF).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/methods.c
Comment thread src/methods.c
Comment thread performance/__main__.py Outdated
@flexatone flexatone merged commit d4d7463 into master Jul 4, 2026
24 checks passed
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.

Add a stable counting-sort / group-ordering primitive for dense factorize codes

2 participants