Make shape handling consistent across package for #509#512
Open
Make shape handling consistent across package for #509#512
Conversation
Added an index filtering step to FeatureConcatenator. Previously, if different featurizers dropped different molecules, the raw arrays were still concatenated, resulting in shape mismatches or mismatched rows. The features are now strictly masked to the common indices prior to concatenation.
This overhaul replaces slow, high-dependency integration tests with true unit tests utilizing pytest-mock and synthetic data fixtures. Key changes include swapping tautological file-writing mocks for internal state assertions, enforcing strict disjoint set validation for chemical splitters, and implementing rigorous mathematical validation for uncertainty quantification and evaluation metrics. These updates significantly improve execution speed and cross-platform stability by replacing fragile floating-point equality with robust approximate comparisons and isolating testing boundaries for featurizers, inference orchestration, and CLI logic.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…un execution-only
…utput-dir semantics
…nd output-dir fallback
for more information, see https://pre-commit.ci
- Strip out unmaintained concrete stub classes. - Use mocker.create_autospec(..., instance=True) to satisfy Pydantic validations. - Centralize mock state injection in the build_workflow helper.
Remove tautological mocking of the model, featurizer, metadata, and data spec in test_inference.py. Replace with real instantiated FingerprintFeaturizer, DummyRegressorModel, CommitteeRegressor, Metadata, and DataSpec objects so that SMILES physically flow through the featurization and prediction pipeline. Only the file I/O boundary (load_anvil_model_and_metadata) remains patched. Assertions now verify mathematically derived values: single model PRED=1.0 (training mean), ensemble PRED=2.0/STD=1.0, and UCB=4.0 (mean + beta*std = 2.0 + 2.0*1.0).
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
updates: - [github.com/PyCQA/isort: 8.0.0 → 8.0.1](PyCQA/isort@8.0.0...8.0.1) - [github.com/astral-sh/ruff-pre-commit: v0.15.2 → v0.15.4](astral-sh/ruff-pre-commit@v0.15.2...v0.15.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Add ensure_2d() to eval/utils.py and replace the four inline (N,) → (N, 1) coercion blocks in RegressionMetrics/RegressionPlots and UncertaintyMetrics/UncertaintyPlots with calls to the shared helper. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
See #509