Repository navigation
test: scoring, physchem, data-loader coverage (516→620 tests) - #19
Merged
Merged
Conversation
Four modules that directly affect candidate scoring and selection had no or minimal dedicated tests. Any bug in them would silently pick the wrong candidates before synthesis. - test_scoring_synthesis.py (17 tests): synthesis_feasibility_score — length penalty boundaries, cysteine/repeat-run flags, cumulative caps - test_scoring_ensemble.py (27 tests): ensemble_score (weighted avg, clamping, zero-weight guard), selection_reasons (all threshold branches), known_failure_modes (novelty/safety/synthesis/disagreement flags) - test_data_loaders.py (15 tests): normalize_sequence, is_valid_sequence (all 20 canonical AA, non-canonical rejection), load_candidates_csv (id/source defaults, sequence normalisation, smoke-test on demo file) - test_physchem.py (44 tests, expanded from 2): net_charge_proxy, fraction (hydrophobic/aromatic/custom), longest_repeat_run (boundary cases), compute_features (all keys, value correctness, empty sequence) Total: 516 → 620 tests. All lint-clean.
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
Coverage added
test_scoring_synthesis.pyscoring/synthesis.py— length penalties, cysteine/repeat-run flags, cumulative clampingtest_scoring_ensemble.pyscoring/ensemble.py— weighted average, clamping, zero-weight guard,selection_reasons,known_failure_modestest_data_loaders.pydata/loaders.py—normalize_sequence,is_valid_sequence(all 20 canonical AA, rejection cases),load_candidates_csvtest_physchem.pyfeatures/physchem.py—net_charge_proxy,fraction,longest_repeat_run,compute_features(all keys, empty sequence, numeric invariants)Why these matter before wet-lab
synthesis_feasibility_scoredirectly gates which candidates are ordered; an off-by-one in the length penalty boundary (31 vs 30) would silently mis-score candidates.ensemble_scoreis the final ranking function; the zero-weight edge case and clamping behaviour were untested.compute_featuresfeeds every scorer — a missing key or wrong fraction would corrupt all downstream scores.load_candidates_csvis the entry point for all user-supplied sequence data; wrong id/source defaults were undocumented.Test plan
pytest -q— 620 passedruff check— no issues