Add preflight guardrails for descriptor/graph/CG workflows - #117
Closed
roshan2004 wants to merge 1 commit into
Closed
Add preflight guardrails for descriptor/graph/CG workflows#117roshan2004 wants to merge 1 commit into
roshan2004 wants to merge 1 commit into
Conversation
Featurisation paths run happily on imperfect input and quietly return degraded results: a structure with no explicit bonds gets a graph whose edges were guessed from distances, one with no residue numbers loses every residue-level feature, and a huge structure asked for an atom-level dense matrix tries to allocate gigabytes. New molscope/preflight.py reads the cheap signals MolScope already computes (quality_report, and with deep=True prepare_structure) and turns the ones that matter into explicit, workflow-scoped warnings — inferred bonds, missing metadata, altLocs/occupancy, no hydrogens, bad element symbols, large dense-matrix sizes, and (deep) chain breaks / missing backbone. It changes no results and is opt-in everywhere: - ms.preflight(source, workflow=..., deep=...) / mol.preflight(...) -> PreflightReport - preflight=True on Molecule.to_graph / descriptors / coarse_grain (emits warnings) - `molscope preflight FILE` command, and --preflight on analyze/export/coarse-grain Adds tests/test_preflight.py (21 tests) and documents it in the README (command table, capability table, workflow section), the structure-QC user guide, the API reference, and the CHANGELOG.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
What
Featurisation paths run happily on imperfect input and quietly return degraded results — a structure with no explicit bonds gets a graph whose edges were guessed from distances, one with no residue numbers loses every residue-level feature, and a huge structure asked for an atom-level dense matrix tries to allocate gigabytes.
Preflight reads the cheap signals MolScope already computes (
quality_report, and withdeep=Trueprepare_structure) and turns the ones that matter into explicit, workflow-scoped warnings before the expensive step runs. It changes no results.What it flags
deep=True(proteins): chain breaks, missing backbone, residue gaps, truncated side chains, non-standard residues, plus a net-charge noteOpt-in everywhere (default off, no behaviour change)
--preflightis also onanalyzeandcoarse-grain.PreflightReporthas.ok,.codes(),.messages(),.summary(),.to_dict(),.emit().Tests & docs
tests/test_preflight.py— 21 tests (each warning code, workflow scoping, deep topology, method integration viapytest.warns, all CLI surfaces).preflight.pypatch coverage 91%.ruff checkclean.