Repository navigation
MAINT: Make the Krippendorff alpha helpers keyword-only - #4304
Merged
Roman Lutz (romanlutz) merged 4 commits intoNov 17, 2026
Merged
Roman Lutz (romanlutz) merged 4 commits into
Roman Lutz (romanlutz) merged 4 commits into
Conversation
Relates to microsoft#4216. The four private helpers in pyrit.score.scorer_evaluation.krippendorff now take one positional parameter and the rest by name. Their only callers are krippendorff_alpha in the same module and the unit tests, which are updated. The public krippendorff_alpha is unchanged. Remove the four entries from the keyword-only baseline and add a test of the helper signatures.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the private-helper keyword-only migration.
No open issues 🎉
What changed in this PR
Advances #4216 by applying PyRIT’s keyword-only convention to four private Krippendorff alpha helpers, without changing the public API or calculation behavior.
Changes:
- Makes parameters after the first keyword-only and updates production and test callers.
- Adds a parameterized test enforcing the helper signatures.
- Removes the four migrated helpers from the keyword-only baseline.
| File | Description |
|---|---|
tests/unit/score/test_krippendorff.py |
Updates helper calls and adds signature regression coverage. |
pyrit/score/scorer_evaluation/krippendorff.py |
Makes four private helper signatures keyword-only and updates internal calls. |
build_scripts/keyword_only_baseline.txt |
Removes the four migrated helper exceptions. |
Review effort: Balanced
Roman Lutz (romanlutz)
approved these changes
Nov 17, 2026
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
Relates to #4216. Make the four private helpers in
pyrit.score.scorer_evaluation.krippendorfffollow PyRIT's keyword-only convention. Behavior is unchanged.level_of_measurement=andmissing=in_validate_and_prepare_data,valid_mask=andcategories=in_build_value_counts_matrix,n_v=in_build_ordinal_distance_matrixandexpected_disagreement=in_compute_alpha_from_disagreements, updating the calls inkrippendorff_alphaand the unit tests, which are their only callers.For
_compute_alpha_from_disagreementsthis also means observed and expected disagreement can no longer be swapped silently in a positional call. The publickrippendorff_alphais unchanged.