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

Small atom mapping debugging #740

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Small atom mapping debugging #740

wants to merge 3 commits into from

Conversation

kfir4444
Copy link
Collaborator

@kfir4444 kfir4444 commented May 6, 2024

Two small fixes for the atom mapping module.

Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 73.79%. Comparing base (3631196) to head (24dc585).

Files Patch % Lines
arc/mapping/engine.py 66.66% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #740      +/-   ##
==========================================
- Coverage   73.80%   73.79%   -0.01%     
==========================================
  Files          99       99              
  Lines       27352    27361       +9     
  Branches     5718     5720       +2     
==========================================
+ Hits        20187    20191       +4     
- Misses       5738     5743       +5     
  Partials     1427     1427              
Flag Coverage Δ
unittests 73.79% <66.66%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

kfir4444 added 3 commits May 6, 2024 11:15
If generate_resonance_structures returns None, then still pass the isomorphism check.
This is done as per the schema by other internal coordinates
@kfir4444 kfir4444 changed the title Small atom mapping debuggin Small atom mapping debugging May 6, 2024
Copy link
Member

@alongd alongd left a comment

Choose a reason for hiding this comment

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

Thanks. Please see two comments

@@ -1117,8 +1117,12 @@ def r_cut_p_cut_isomorphic(reactant, product):
bool: ``True`` if they are isomorphic, ``False`` otherwise.
"""
res1 = generate_resonance_structures(object_=reactant.mol.copy(deep=True), save_order = True)
Copy link
Member

Choose a reason for hiding this comment

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

I would recommend to modify the generate_resonance_structures func so it always returns at least the original Molecule. Please see where else this func is used and whether this change will be appropriate

except VectorsError:
# Trying to map a linear torsion
# but the torsion is undefined, since v1 x v2 = 0 if v1 || v2
# using other internal coordinates to map the hydrogens.
Copy link
Member

Choose a reason for hiding this comment

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

does this fix solve the issue or skips it? We could consider using a different atom instead of the last atom in the torsion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants