Add strong regression unit tests - #80
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR strengthens the stereo-regression safety net by adding regression-focused contract tests (including CLI wiring) meant to catch unintended behavior changes when shared infrastructure evolves, alongside small supporting fixes in utilities and preprocessing.
Changes:
- Add extensive regression contract/guard test coverage for stereo training, loading, inference, and streaming behavior.
- Harden utility behavior (e.g., ignore directories when discovering
*.joblib*artifacts) and adjust regression residual preprocessing to avoid invalid log operations. - Update development tooling configuration (Ruff + pre-commit hook revisions).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_utils.py | Adds regression-oriented unit tests for utility helpers (joblib discovery, image selection parsing, model parameter loading, memory profiling, joblib loading). |
| tests/test_regression_shared_contracts.py | Adds shared-infrastructure contract tests to ensure classification-side refactors don’t break regression behavior. |
| tests/test_regression_production_guard.py | Adds comprehensive “production guard” tests covering regression train/apply/load/streaming internals and invariants. |
| tests/test_regression_contracts.py | Adds regression boundary/contract tests for persisted feature order, residual inversion, and ROOT output behavior. |
| tests/scripts/test_stereo_entrypoints.py | Adds console-script wiring tests for stereo train/apply entrypoints. |
| src/eventdisplay_ml/utils.py | Filters discovered *.joblib* entries to files only; provides memory profiling and joblib-load warning suppression used by new tests. |
| src/eventdisplay_ml/data_processing.py | Makes MC log-energy computation explicit and avoids logging invalid energies during residual construction. |
| pyproject.toml | Updates Ruff configuration (notably adds force-exclude and excludes tests/). |
| .pre-commit-config.yaml | Bumps pre-commit hook revisions (Ruff/isort/codespell). |
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
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.
No description provided.