Skip to content

refactor(610): remove the deprecated confusion_matrix_calculator shim - #613

Open
WilliamK112 wants to merge 1 commit into
awslabs:devfrom
WilliamK112:fix/610-remove-cm-calculator-shim
Open

WilliamK112 wants to merge 1 commit into
awslabs:devfrom
WilliamK112:fix/610-remove-cm-calculator-shim

Conversation

@WilliamK112

Copy link
Copy Markdown
Contributor

Issue #, if available: Fixes #610

Description of changes:

#596 restored stickler.structured_object_evaluator.models.confusion_matrix_calculator as a deprecated shim for 1.0.x, warning that it "will be removed in 1.1.0". Nothing in Stickler imports it, so this PR removes it:

  • deletes src/stickler/structured_object_evaluator/models/confusion_matrix_calculator.py and tests/structured_object_evaluator/test_confusion_matrix_calculator_shim.py;
  • adds a ### Removed bullet under [Unreleased] in CHANGELOG.md.

git grep confusion_matrix_calculator now finds the two CHANGELOG bullets and one sentence in docs/structured_model_REFACTORING.md. That sentence says #406 removed confusion_matrix_calculator.py, which is true again once the shim is gone, so I left it. I can reword it if you'd rather the filename appear only in the CHANGELOG.

Checks, on dev at 567cf2c: uv run pytest -q gives 5,931 passed, 13 skipped, 1 xfailed. The 6 fewer passes are the deleted shim tests. The 30 failures are the same ones dev has on this Windows machine (HTML report, deep-nesting timeout, printer and docs-drift tests), and CI is the reference for those.

Written with Claude Code.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

🤖 Generated with Claude Code

awslabs#596 restored the module for 1.0.x with a DeprecationWarning promising
removal in 1.1.0. Nothing in Stickler imports it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vawsgit vawsgit 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.

✅ LGTM!

No medium or high findings. Verified at head d7c4482, which sits directly on current dev (merge-base 567cf2c = origin/dev).

What was checked

  • Scope. git diff --stat origin/dev...d7c4482 touches 3 files: the shim module (−124), its test (−43), and CHANGELOG.md (+7). No config, CI or lockfile changes, so nothing on dev is reverted on merge.
  • Removal matches the promise. The 1.0.2 ### Deprecated entry says the shim "will be removed in 1.1.0" (CHANGELOG.md#L84-L89). Issue #610 is on the 1.1.0 milestone, so this is the planned removal, not an unplanned break. The new ### Removed bullet (CHANGELOG.md#L12-L17) links #610. Fixes #610 is correct: the PR delivers the module deletion, the test deletion and the CHANGELOG bullet.
  • No remaining references. rg 'confusion_matrix_calculator|ConfusionMatrixCalculator|classify_field_for_confusion_matrix' over src/, tests/, docs/, examples/, README.md and mkdocs.yml finds only docs/structured_model_REFACTORING.md#L159, which says #406 removed the file. That sentence is accurate again once the shim is gone, so leaving it is fine.
  • Import fails cleanly. import stickler.structured_object_evaluator.models.confusion_matrix_calculator raises ModuleNotFoundError. Tested against the PR worktree's src/ (path printed with inspect.getfile(stickler)).
  • Helpers still used. field_helper, null_helper and threshold_helper, which the shim imported, are still imported elsewhere in src/.
  • Suite. With CI's extras (--extra llm --extra bert), uv run pytest -q -n auto: 5978 passed, 3 skipped, 1 xfailed. The 6 fewer tests than before are the deleted shim tests. tests/test_docs_build.py: 77 passed, no skips, including the docs-drift tests that read the CHANGELOG's newest section. ruff check .: all checks passed.
  • Mutation testing. Not applicable: the PR adds or changes no tests.

Non-blocking note

  • CI has not run on this fork PR. The workflow runs for d7c4482 are action_required and need a maintainer to approve them. Let them go green before merging.

This branch has not been deployed

No deployments
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.

Remove the deprecated confusion_matrix_calculator shim

2 participants