Skip to content
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

Merged
merged 5 commits into from
Feb 9, 2024
Merged

Issue 170 lam validators #287

merged 5 commits into from
Feb 9, 2024

Conversation

richardjgowers
Copy link
Contributor

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.

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
@pep8speaks
Copy link

pep8speaks commented Feb 8, 2024

Hello @richardjgowers! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 173:80: E501 line too long (81 > 79 characters)

Comment last updated at 2024-02-09 09:58:38 UTC

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b673fed) 98.93% compared to head (6c6318d) 98.93%.

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.
📢 Have feedback on the report? Share it here.

@richardjgowers richardjgowers added this to the Release 1.0.0 milestone Feb 8, 2024
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}")
Copy link
Contributor

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}?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops yes!

@richardjgowers richardjgowers merged commit c998c5e into main Feb 9, 2024
10 checks passed
@richardjgowers richardjgowers deleted the issue-170_LAM_validatosr branch February 9, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants