Skip to content

test(rl): use a stable sort in test_sorted_data_passes - #1415

Merged
krishnbera merged 1 commit into
lnccbrown:mainfrom
AxelNoun:test-sorted-data-stable-sort
Oct 20, 2026
Merged

krishnbera merged 1 commit into
lnccbrown:mainfrom
AxelNoun:test-sorted-data-stable-sort

Conversation

@AxelNoun

@AxelNoun AxelNoun commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #1411 (#1410), addressing the non-blocking nit from @krishnbera's review.

I used an AI assistant (Claude Code) to make this change and draft this description.

Summary by CodeRabbit

  • Tests
    • Updated balanced-panel test coverage to preserve trial order within participants when sorting interleaved data.
    • Documented that default sorting may reorder trials.

The test sorted an interleaved panel with pandas' default sort, the
pattern that lnccbrown#1410 warns against. Use kind="stable", as the error
message of validate_balanced_panel now recommends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 93c72165-179a-4c10-9ccd-911a95298504
📥 Commits

Reviewing files that changed from the base of the PR and between 876b201 and f7cccbc.

📒 Files selected for processing: 1
  • tests/rl/test_rl_utils.py

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

📝 Walkthrough

The balanced-panel test now uses stable sorting for interleaved data. Its documentation notes that default sorting may reorder trials within a participant.

Changes: Balanced-panel test

Layer / File(s) Summary
Verify stable participant sorting
tests/rl/test_rl_utils.py
The test sorts interleaved data with kind="stable" and documents that default sorting may reorder within-participant trial order.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: cpaniaguam

Merge Risk: ⚪ Minimal · up to f7ccc

No merge-blocking risk remains in this test-only change.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: using a stable sort in the test_sorted_data_passes test.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@krishnbera krishnbera left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm! thanks @AxelNoun

@krishnbera
krishnbera merged commit 404d249 into lnccbrown:main Oct 20, 2026
5 checks passed
@AxelNoun
AxelNoun deleted the test-sorted-data-stable-sort branch October 20, 2026 21:23
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.

2 participants