Repository navigation
test(dynacell/eval): stub the metrics names added since #499 and #500 - #516
Merged
Merged
Conversation
_import_pipeline_with_stubs replaces dynacell.evaluation.metrics with a module listing only the names pipeline imports. #499 added a CP_FEATURE_NAMES_BY_VERSION import in pipeline_cache and #500 added a round_device_dependent_cp_columns import in cp_reference. The stub lacked both, so the test raised ImportError whenever it ran before any other test had imported the real modules -- alone, or first on an xdist worker. Every top-level metrics import in the package is now stubbed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kuht3npKtb2o5E6h19xbA
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test-only changes correctly satisfy the newly introduced imports.
Review effort: Balanced
Findings: None
What changed in this PR
Updates the Dynacell evaluation pipeline test stubs to match newly imported metrics APIs, ensuring reliable isolated execution.
Changes:
- Adds the CP feature-name mapping stub.
- Adds the device-dependent CP rounding stub.
| File | Description |
|---|---|
applications/dynacell/tests/test_evaluation_pipeline.py |
Completes metrics stubs required by the evaluation pipeline import chain. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
test_evaluate_model_reuses_cache_without_feature_metricsfails whenever it runs first in its process: on its own, or as the first test on an xdist worker. It passes only when an earlier test has already imported the realcp_referenceandpipeline_cache.The cause:
_import_pipeline_with_stubsswapsdynacell.evaluation.metricsfor a stub module that lacked two names imported at module top:CP_FEATURE_NAMES_BY_VERSION, frompipeline_cache, added in fix(dynacell/eval): score GLCM+/CP metrics in one GT-fit feature space #499;round_device_dependent_cp_columns, fromcp_reference, added in fix(dynacell/eval): round CP intensity_min/max to float32 on both devices #500.An AST scan of every top-level
from dynacell.evaluation.metrics import …in the package now finds all names present in the stub.Verified: run alone, the test failed before this change (on both the main
.venvandcpdino-eval-cubic090a3) and passes after it.🤖 Generated with Claude Code
https://claude.ai/code/session_015kuht3npKtb2o5E6h19xbA