Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions docs/structured_model_REFACTORING.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class StructuredModel(BaseModel):

### Legacy private methods are kept as delegating shims

Older callers (and many tests) reach for private methods on `StructuredModel` such as `_dispatch_field_comparison`, `compare_recursive`, `_calculate_list_confusion_matrix`, `_calculate_nested_field_metrics`, `_collect_enhanced_non_matches`, `_add_derived_metrics_to_result`, `_format_for_evaluator`, etc. These were **not removed** — they now exist as one-line wrappers that build the appropriate component and forward the call. They are retained for backward compatibility; new code should call the component directly.
Older callers (and many tests) reach for private methods on `StructuredModel` such as `_dispatch_field_comparison`, `compare_recursive`, `_collect_enhanced_non_matches`, `_add_derived_metrics_to_result`, `_format_for_evaluator`, etc. These were **not removed** — they now exist as one-line wrappers that build the appropriate component and forward the call. They are retained for backward compatibility; new code should call the component directly.

## Component Responsibilities

Expand Down Expand Up @@ -375,9 +375,6 @@ These methods still exist on `StructuredModel` as thin delegating shims for back
| `compare_recursive` | `ComparisonEngine.compare_recursive` |
| `compare_with` | `ComparisonEngine.compare_with` |
| `_classify_field_for_confusion_matrix`| `ConfusionMatrixCalculator.classify_field_for_confusion_matrix` |
| `_calculate_list_confusion_matrix` | `ConfusionMatrixCalculator.calculate_list_confusion_matrix` |
| `_calculate_nested_field_metrics` | `ConfusionMatrixCalculator.calculate_nested_field_metrics` |
| `_calculate_single_nested_field_metrics` | `ConfusionMatrixCalculator.calculate_single_nested_field_metrics` |
| `_add_derived_metrics_to_result` | `DerivedMetricsCalculator.add_derived_metrics_to_result` |
| `_collect_enhanced_non_matches` | `NonMatchCollector.collect_enhanced_non_matches` |
| `_format_for_evaluator` | `EvaluatorFormatHelper.format_for_evaluator` |
Expand Down
6 changes: 3 additions & 3 deletions src/stickler/algorithms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ true positives. `ComparisonHelper.compare_unordered_lists` builds a matcher
this way on purpose and reads only `matched_pairs`. Nothing should read `tp`
from a matcher built with `0.0`.

**The threshold test here is exact.** `ThresholdHelper`, `ComparisonHelper` and
`ConfusionMatrixCalculator` accept a score up to `1e-10` under the threshold, so
a score inside that window is a TP there and an FD here.
**The threshold test here is exact.** `ThresholdHelper` and `ComparisonHelper`
accept a score up to `1e-10` under the threshold, so a score inside that window
is a TP there and an FD here.

## How the evaluator uses it

Expand Down
9 changes: 4 additions & 5 deletions src/stickler/algorithms/hungarian.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,10 @@ def calculate_metrics(self, list1: Any, list2: Any) -> dict:
other convention, so the same counts read lower here than they do
as ``cm_recall`` there.

The threshold test here is a bare ``>=``. ``ThresholdHelper``,
``ComparisonHelper`` and ``ConfusionMatrixCalculator`` use a
tolerant test that accepts a score up to ``1e-10`` under the
threshold, so a score inside that window is a TP there and an FD
here.
The threshold test here is a bare ``>=``. ``ThresholdHelper`` and
``ComparisonHelper`` use a tolerant test that accepts a score up
to ``1e-10`` under the threshold, so a score inside that window is
a TP there and an FD here.

``match_threshold=0.0`` is used elsewhere as a capture all
sentinel. Every score satisfies ``>= 0.0``, so ``tp`` then counts
Expand Down
Loading
Loading