Skip to content

MAINT: Make the Krippendorff alpha helpers keyword-only - #4304

Merged
Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
Allan-dq:maint/keyword-only-krippendorff
Nov 17, 2026
Merged

Roman Lutz (romanlutz) merged 4 commits into
microsoft:mainfrom
Allan-dq:maint/keyword-only-krippendorff

Conversation

@Allan-dq

@Allan-dq Qin Dai (Allan-dq) commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

Relates to #4216. Make the four private helpers in pyrit.score.scorer_evaluation.krippendorff follow PyRIT's keyword-only convention. Behavior is unchanged.

  • Require level_of_measurement= and missing= in _validate_and_prepare_data, valid_mask= and categories= in _build_value_counts_matrix, n_v= in _build_ordinal_distance_matrix and expected_disagreement= in _compute_alpha_from_disagreements, updating the calls in krippendorff_alpha and the unit tests, which are their only callers.
  • Remove the four helpers from the baseline.

For _compute_alpha_from_disagreements this also means observed and expected disagreement can no longer be swapped silently in a positional call. The public krippendorff_alpha is unchanged.

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.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 05:47

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.

🟢 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

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Nov 17, 2026
Merged via the queue into microsoft:main with commit 35f0c3f Nov 17, 2026
63 of 64 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.

3 participants