test: regression suite for the predict.py rule/computed packs - #49
Merged
Merged
Conversation
Covers the deterministic, model-independent logic so the π‘ "built but unvalidated" packs in BUILD-STATUS become regression-guarded β and CI actually exercises them: - test_rules: sour/salty calls (incl. MSG defers to the organic anion), allergen labeling, the documented dangerous-mixture screen (nitrite + amine -> nitrosamine). - test_physchem: physchem MW/logP/solubility, stability motif flags (vanillin's phenol + aldehyde), chemesthesis (astringent polyphenol, pungent isothiocyanate). - test_predict: predict() stays well-formed and never crashes with NO trained models (the CI case); bad-SMILES handling; predict_aroma honest placeholder. - test_substitute: graceful with no reference set; correct Tanimoto ranking against a hand-built in-memory index (no data files needed). Infra: requirements.txt (core runtime deps) and CI installs it before pytest, so the suite runs in CI without trained models or datasets. 19 tests, all green. Signed-off-by: Austin L. <86896075+rvnminers-A-and-N@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.
Turns the π‘ "built but unvalidated" packs in
BUILD-STATUS.mdinto regression-guarded β , and makes CI actually run Python tests (it previously only hadruff+ a no-op pytest skip).Coverage (19 tests, all model-independent so they run in CI)
test_rules.py) β sour/salty (incl. MSG deferring to the organic anion, NaCl firing), EU allergen labeling, dangerous-mixture screen (nitrite + secondary amine β nitrosamine), empty-mixture well-formedness.test_physchem.py) β physchem MW/logP/solubility, stability motif flags (vanillin's phenol + aldehyde), chemesthesis (astringent polyphenol, pungent isothiocyanate, silent on plain molecules).test_predict.py) β stays well-formed and never crashes with no trained models (the CI case); rejects bad SMILES;predict_aroma()honest placeholder.test_substitute.py) β graceful with no reference set; correct Tanimoto ranking via a hand-built in-memory index.Infra
requirements.txtβ core runtime deps (rdkit, numpy, pandas, scikit-learn, joblib, pyarrow).ci.ymlβ installsrequirements.txtbeforepytest, so the suite runs without trained models or datasets.Verified locally from the repo root with no models present (mirrors CI): 19 passed,
ruffclean.