1209: Skip subgroups with too few comparators in get_pairwise_comparisons()#1214
Draft
nikosbosse wants to merge 1 commit into
Draft
1209: Skip subgroups with too few comparators in get_pairwise_comparisons()#1214nikosbosse wants to merge 1 commit into
nikosbosse wants to merge 1 commit into
Conversation
…odels (#1209) get_pairwise_comparisons() split scores by 'by' and aborted as soon as any subgroup had fewer than two comparators, discarding results for all valid subgroups and without naming the offending subgroup. Subgroups with fewer than two comparators are now skipped with a warning that names them (as col=value pairs), and results are returned for the remaining subgroups; add_relative_skill() fills NA for skipped subgroups. If no subgroup has at least two comparators, the previous error is kept, and the safeguard in pairwise_comparison_one_group() stays in place for direct calls. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1214 +/- ##
==========================================
+ Coverage 98.15% 98.17% +0.01%
==========================================
Files 41 41
Lines 2225 2246 +21
==========================================
+ Hits 2184 2205 +21
Misses 41 41 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
Author
|
Automated review (Claude Fable, directed by @nikosbosse): Verdict: approve. Verified independently in a clean worktree:
Minor, non-blocking observations:
|
nikosbosse
marked this pull request as draft
July 18, 2026 13:53
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR closes #1209.
get_pairwise_comparisons()split scores into subgroups bybyand then aborted as soon as any subgroup had fewer than two comparators, discarding results for all valid subgroups and without saying which subgroup was the problem.add_relative_skill()inherited the same behaviour.With this PR, subgroups with fewer than two comparators are skipped with a warning that names them (as
col=valuepairs, e.g."target_type=Deaths"), and results are returned for the remaining subgroups.add_relative_skill()fillsNAfor the skipped subgroups. If no subgroup has at least two comparators (includingby = NULLwith a single model), the previous error is kept unchanged, and the safeguard insidepairwise_comparison_one_group()remains for direct calls.Tests were written first and failed on the unfixed code:
After the fix, the full test suite passes (0 failed, 915 passed). Note: the two
vdiffrdoppelganger snapshots forplot_pairwise_comparisons()fail locally on unmodifiedmainas well (environment-dependent rendering) and are unrelated to this change.Dev note: bug identified by an LLM audit (#1189); fix and tests implemented with LLM support, directed by @nikosbosse.
Checklist
lintron the changed files; no new style issues were introduced by my changes.