Skip to content

Improve sensitivity coverage with focused executor unit tests#1343

Merged
SkBlaz merged 4 commits intomasterfrom
copilot/profile-test-coverage-sub-modules
Apr 12, 2026
Merged

Improve sensitivity coverage with focused executor unit tests#1343
SkBlaz merged 4 commits intomasterfrom
copilot/profile-test-coverage-sub-modules

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

Summary

Adds focused unit tests for py3plex/sensitivity/executor.py and metric-spec parsing to improve coverage in the low-covered sensitivity area.

Changes

  • Added new test module: tests/test_sensitivity_executor.py
  • Added coverage for:
    • _extract_conclusion_data (dict input, to_dict() object input, uncertainty-wrapped values)
    • _compute_stability_metric dispatch and unknown-metric fallback
    • _find_collapse_point found/not-found behavior
    • _compute_local_influence per-node score behavior
    • run_sensitivity_analysis deterministic flow under monkeypatched perturbation
    • run_sensitivity_analysis instability detection (non-perfect stability)
    • parse_metric_spec variants
  • Kept tests lightweight and deterministic with monkeypatched perturbation behavior and direct sensitivity module loading in the test context.

Validation

  • Ran targeted tests successfully:
    • python3 -m pytest tests/test_sensitivity_executor.py tests/property/test_sensitivity_properties.py -q

Notes

  • In this sandbox environment, coverage-plugin runs hit an environment-specific NumPy import issue (cannot load module more than once per process) when measuring coverage directly, so validation used targeted pytest execution.

Copilot AI requested a review from SkBlaz April 12, 2026 05:51
@SkBlaz SkBlaz marked this pull request as ready for review April 12, 2026 09:02
@SkBlaz SkBlaz merged commit 248fc2e into master Apr 12, 2026
34 checks passed
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.

2 participants