refactor(seqopt): make SeqOpt core (lazy ShapModel); only mode='impact' needs pro#279
Merged
Merged
Conversation
…t' needs pro SeqOpt's EA machinery, plots, and mode='importance' are all pure-Python and need nothing pro; only the SHAP-guided mode='impact' needs shap. So: - Import ShapModel lazily inside the impact path; SeqOpt is now importable in a base install. Constructing mode='impact' without shap raises a friendly aaanalysis[pro] hint. - Move SeqOpt/SeqOptPlot + _backend/seqopt/ from protein_design_pro/ into the core protein_design/ subpackage; remove the now-empty protein_design_pro package. - __init__.py: replace the pro try/except gate with core exports of SeqOpt/SeqOptPlot. - DEDICATED_OWNERS, test imports (+ rename tests dir -> seqopt_tests, shap-guard only the impact tests), comparison script, [pro] markers, ADR-0043 (D1 amended), CONTEXT, release notes and the docstring-guide table all updated to 'core; impact needs pro'. Verified: SeqOpt imports + mode='importance' runs with shap blocked; mode='impact' raises the pro hint. 96 SeqOpt tests + 0 docstring defects. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #279 +/- ##
==========================================
- Coverage 96.13% 96.13% -0.01%
==========================================
Files 176 175 -1
Lines 16827 16823 -4
Branches 2877 2877
==========================================
- Hits 16176 16172 -4
Misses 366 366
Partials 285 285
🚀 New features to boost your workflow:
|
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
Make SeqOpt a core class — only the SHAP-guided
mode="impact"needsaaanalysis[pro].The EA machinery (NSGA-II, all operators),
SeqOptPlot, andmode="importance"are pure-Python and need nothing pro; onlymode="impact"uses SHAP. So:ShapModelimport inside the impact path →SeqOptis importable in a base install. Constructingmode="impact"withoutshapraises a friendlyaaanalysis[pro]install hint.SeqOpt/SeqOptPlot+_backend/seqopt/fromprotein_design_pro/into the coreprotein_design/subpackage; removed the now-emptyprotein_design_propackage.__init__.py: pro try/except gate → core exports ofSeqOpt/SeqOptPlot.DEDICATED_OWNERS, test imports (+ tests dir →seqopt_tests,shap-guard only the impact tests), the comparison script, the[pro]markers, ADR-0043 (D1 amended), CONTEXT.md, the release note, and the docstring-guide table — all to "core;mode="impact"needspro".Verification
Verified with
shapblocked (simulated base install):importworks,mode="importance"runs,mode="impact"raises the pro hint — with a regression test. 96 SeqOpt tests + 268 in the broad gate; docstrings 0 defects; merged current with master.(Why: the convention test
test_docstring_contractsrequires every*_prosymbol to be[pro], so a core class can't live in a_propackage — hence the move.)🤖 Generated with Claude Code