Repository navigation
test: safety_score + activity_likeness_score boundary coverage - #22
Merged
Merged
Conversation
…isk/component boundaries - tests/test_scoring_safety.py (32 tests): every risk condition boundary-tested with explicit arithmetic: μH threshold (0.55), hydrophobic fraction (0.65), charge density (0.55, uses abs), length (>35 flat +0.25), cysteine (>0.25 flat +0.20), repeat run (>=6 flat +0.15); cumulative clamping, missing μH key - tests/test_scoring_activity.py (29 tests): clamp01 + every scoring component of activity_likeness_score: length (peak at 18, zero at ±43), charge (clamped at cd>=0.50), hydrophobic (peak at 0.45), aromatic bonus (cap at 0.20→0.10 max), amphipathicity bonus (cap at μH=0.8→0.15 max); monotonicity sweep; AMP positive/negative known-sequence spot checks 769 tests total (was 708).
… test - test_scoring_activity.py: add test_length_30_midrange_verifies_normalization_constant (catches silent change to the /25 denominator) and test_hydrophobic_225_midrange_verifies_normalization_constant (catches silent change to the /0.45 denominator); these were flagged by code reviewer as the only tests that would fail if constants were changed - test_scoring_safety.py: move test_no_hydrophobic_moment_feature_defaults_to_zero from TestCumulativePenalties to TestSafetyScoreBaseline (it tests a default parameter, not penalty accumulation)
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
tests/test_scoring_safety.py— every risk condition insafety_scorewith explicit arithmetic, all 6 penalties (μH, hydrophobic fraction, charge density, length, cysteine, repeat run), boundary conditions (at-threshold vs. above), cumulative clamping, missing-key defaulttests/test_scoring_activity.py—clamp01+ all 5 components ofactivity_likeness_score(length peak/floor, charge saturation, hydrophobic optimum, aromatic bonus cap, amphipathicity bonus cap + monotonicity), positive/negative known-sequence spot checksThese were the two core scoring functions driving the synthesis decision panel — safety_score had only 7 tests (no boundary arithmetic), activity_likeness_score had no dedicated unit tests at all.
Test plan