Repository navigation
[REFACTOR] remove dead code and duplication, tidy naming and packaging - #8
Merged
Merged
Conversation
build_all, build_model, the target_layer_name option and three TrainResult fields had no caller outside their own tests. Each was surface to read and keep working with no user behind it. The model config tests now exercise ModelConfig directly, which is where the validation actually lives.
The trainer carried its own copy of collate_without_masks, and Score-CAM its own copy of the min-max scaling inside to_heatmap. Two copies drift: a fix to one would silently miss the other.
channel_statistics is also fed SyntheticDefects, so its KolektorSDD2 hint was wrong and pulled in an import only for that. The trainer's function-local import of load_checkpoint guarded against no cycle; the same package is already imported at the top.
The console script is the documented way to run it now; usage lines and the missing-dataset hint still pointed at python -m.
It was installed into every dev environment without ever being invoked.
It was written in both pyproject.toml and __init__.py, so a release could bump one and leave --version reporting the other. Hatch now reads it from __init__.py.
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.
Why
Cleanup pass after the uv migration: code with no caller, logic copied in two places, and leftovers that still pointed at
python -m. No behaviour change intended.Changes
build_all,build_model, the never-passedtarget_layer_nameoption and three unreadTrainResultfields. Model-config validation tests now targetModelConfigdirectly.collate_without_masks; Score-CAM andto_heatmapsharemin_max_per_sample.channel_statisticsis typed byDataset(it is also fed synthetic data); hoist a function-local import in the trainer.classify-justify.pytest-cov.__init__.pyby hatch, so it lives in one place.Deferred on purpose: sharing the trainer's dataset factory with
evaluateand splitting_run_evaluate. Both are entangled with the--splitbug and the silent preprocessing defaults, and belong with those fixes.Testing
ruff checkclean,pytest140 passed (one test removed withbuild_model).mainand on this branch (train, evaluate all 18 methods with--sanity, explain): checkpoint weights, evaluation JSON, every method's heatmap and the explain figure are bit-identical.explainandevaluaterun on MPS; the built wheel installs with plain pip and reports0.1.0.