Repository navigation
refactor: demote EvaluatorFormatHelper to functions in evaluator_output.py - #196
Closed
andreyholovko wants to merge 2 commits into
Closed
andreyholovko wants to merge 2 commits into
andreyholovko wants to merge 2 commits into
Conversation
…ut.py Per issue #134's helper-consolidation plan (item: evaluator_format_helper - "earn the seam, rename" - "owns evaluator-output formatting logic, the name is generic"). The issue doesn't give an explicit target filename for this one (unlike hungarian_matching.py or scoring_formulas.py); picked evaluator_output.py since that's what the module actually produces. EvaluatorFormatHelper was already 100% @staticmethod, calling itself via class-qualified names (EvaluatorFormatHelper.method(...)). Converted all 3 methods (format_for_evaluator, calculate_list_item_metrics, and the internal _flatten_confusion_matrix_for_evaluator, kept underscore-prefixed since it's only called from format_for_evaluator itself) to module-level functions. Only one caller file, structured_model.py (2 call sites, both thin delegating shims) - checked for the same kind of naming collision that bit the rich_value_helper PR, none here. Left the internal HungarianHelper/MetricsHelper imports and instantiations inside this file untouched - those belong to the (currently separate, still-open) #193/#194 PRs in this series; touching them here would create unnecessary merge friction between independent PRs. No behavior change: full suite passes unchanged, 1541/1541, 2 pre-existing unrelated skips. No new tests - pure rename/demotion, no new formula or invariant to pin. Updates the three usual docs plus two more references (structured_model_REFACTORING.md had 3 separate mentions: a component-tree entry, a component list, and a legacy-method mapping table). Contributes to #134 (8 of 13 helpers; 5 remain, plus field_helper.py deferred due to a conflicting open PR #183).
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.
Summary
Contributes to #134 (item from the helper-consolidation treatment table:
evaluator_format_helper- "earn the seam, rename" - "owns evaluator-output formatting logic, the name is generic"). 5 of 13 items remain
(
field_helper.pydeferred separately due to a conflicting open PR #183,not counted as done here); not closing the issue.
The issue doesn't give an explicit target filename for this one (unlike
hungarian_matching.pyorscoring_formulas.py); pickedevaluator_output.pysince that's what the module actually produces.EvaluatorFormatHelperwas already 100%@staticmethod, calling itselfvia class-qualified names. Converted all 3 methods
(
format_for_evaluator,calculate_list_item_metrics, and the internal_flatten_confusion_matrix_for_evaluator, kept underscore-prefixedsince it's only called from
format_for_evaluatoritself) tomodule-level functions.
structured_model.py(2 call sites, both thindelegating shims) - checked for the same kind of naming collision that
came up in the
rich_value_helperPR; none here.HungarianHelper/MetricsHelperimports andinstantiations inside this file untouched - those belong to the
currently-separate, still-open refactor: rename MetricsHelper to scoring_formulas.py (earn the seam) #193/refactor: rename HungarianHelper to HungarianMatching (earn the seam) #194 PRs in this series; touching
them here would create unnecessary merge friction between independent
PRs.
Testing
No behavior change: full suite passes unchanged, 1541 passed, 2
pre-existing unrelated skips. No new tests - pure rename/demotion, no new
formula or invariant to pin.
ruff checkclean on all touched files.Updates the three usual docs plus two more references found in
structured_model_REFACTORING.md(a component-tree entry, a componentlist, and a legacy-method mapping table - three separate mentions in that
one file).
By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your choice.