Overhaul active learning unit tests to use real components and pytest-mock#543
Open
smcolby wants to merge 1 commit into
Open
Overhaul active learning unit tests to use real components and pytest-mock#543smcolby wants to merge 1 commit into
smcolby wants to merge 1 commit into
Conversation
…-mock - Add test_acquisition.py: validates each acquisition function against its mathematical formula using numpy arrays - Refactor test_active_learning.py: replace integration-style tests (loading real anvil models from disk) with lightweight synthetic data and DummyRegressorModel; assert actual calibration math and mutual- exclusion properties; use pytest.approx / assert_allclose throughout - Add test_ensemble_base.py: covers get_ensemble_class success and invalid-type error paths Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
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.
Summary
Rewrites the active learning unit test suite to conform to the new unit test standards.
Changes
test_acquisition.py(new) — validates each acquisition function (max_uncertainty_reduction,exploitation,probability_improvement,expected_improvement,upper_confidence_bound) against its explicit mathematical formula using synthetic numpy arrays; verifies all shorthandaliases map to the correct implementations
test_active_learning.py(refactored) — replaces integration-style tests that loaded real anvil models from disk with lightweightsynthetic data and
DummyRegressorModel; covers committee query/predict, calibration (isotonic regression + scaling factor), save/load andserialize/deserialize round-trips, and uncertainty calibration plots; uses
assert_allclosethroughouttest_ensemble_base.py(new) — coversget_ensemble_classfor a valid key and raisesValueErrorfor an unknown key