-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 170 lam validators #287
Conversation
since we're only exposing a copy of the annotations it's safe enough
use Chem.AddHs() on fixtures to make test cases more realistic this changes the hash of the resulting test as the hash of the SmallMoleculeComponent within has changed
catches some cases where bad indices are provided fixes #170
Hello @richardjgowers! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-02-09 09:58:38 UTC |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #287 +/- ##
=======================================
Coverage 98.93% 98.93%
=======================================
Files 36 36
Lines 1969 1979 +10
=======================================
+ Hits 1948 1958 +10
Misses 21 21 ☔ View full report in Codecov by Sentry. |
gufe/mapping/ligandatommapping.py
Outdated
for i, j in componentA_to_componentB.items(): | ||
if not (0 <= i < nA): | ||
raise ValueError(f"Got invalid index for ComponentA ({i}); " | ||
f"must be 0 <= n <= {nA}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be must be 0 <= n < {nA}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops yes!
Adds a check to LigandAtomMapping that indices are possibly within the molecules. E.g. if I provide index 100 to a molecule with 10 atoms then something isn't correct and I can provide an error immediately.