Skip to content

Make shape handling consistent across package for #509#512

Open
dwwest wants to merge 42 commits intomainfrom
shape_handling
Open

Make shape handling consistent across package for #509#512
dwwest wants to merge 42 commits intomainfrom
shape_handling

Conversation

@dwwest
Copy link
Copy Markdown
Contributor

@dwwest dwwest commented Mar 5, 2026

See #509

smcolby and others added 30 commits February 25, 2026 16:19
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.
- 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).
@dwwest dwwest closed this Mar 5, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 5, 2026

Codecov Report

❌ Patch coverage is 92.10526% with 9 lines in your changes missing coverage. Please review.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dwwest dwwest reopened this Mar 5, 2026
pre-commit-ci bot and others added 2 commits March 6, 2026 14:29
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>
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.

3 participants