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

Fix inconsistent molecule fingerprint generation #1741

Merged
merged 1 commit into from
Oct 2, 2019
Merged

Conversation

mliu49
Copy link
Contributor

@mliu49 mliu49 commented Oct 2, 2019

Motivation or Problem

The updated fingerprint approach resulted in different fingerprint depending on atom order when the molecule contained more than two elements aside from CHNOS.

This fixes #1740.

Description of Changes

This fixes the issue by sorting the elements alphabetically.

Testing

A unit test was written and the case outlined in the issue was also confirmed to work properly.

The updated fingerprint approach resulted in different
fingerprint depending on atom order when the molecule contained
more than two elements aside from CHNOS.

This fixes the issue by sorting the elements alphabetically.
@alongd
Copy link
Member

alongd commented Oct 2, 2019

Good catch! Thanks for the fast fix!
The code looks good, waiting for the tests.

@codecov
Copy link

codecov bot commented Oct 2, 2019

Codecov Report

Merging #1741 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1741      +/-   ##
==========================================
- Coverage   32.61%   32.61%   -0.01%     
==========================================
  Files          87       87              
  Lines       26102    26103       +1     
  Branches     6869     6870       +1     
==========================================
  Hits         8514     8514              
+ Misses      16629    16619      -10     
- Partials      959      970      +11
Impacted Files Coverage Δ
rmgpy/molecule/molecule.py 0% <0%> (ø) ⬆️
rmgpy/data/statmech.py 42.2% <0%> (ø) ⬆️
rmgpy/rmg/pdep.py 12.21% <0%> (ø) ⬆️
rmgpy/reaction.py 0% <0%> (ø) ⬆️
rmgpy/data/kinetics/family.py 48.28% <0%> (ø) ⬆️
rmgpy/yml.py 15.71% <0%> (ø) ⬆️
rmgpy/data/kinetics/database.py 50.61% <0%> (ø) ⬆️
rmgpy/rmg/input.py 34.34% <0%> (ø) ⬆️
rmgpy/statmech/ndTorsions.py 59.78% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce53e34...7e0a9d2. Read the comment docs.

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 for this fix!

@alongd alongd merged commit 16a6b8b into master Oct 2, 2019
@alongd alongd deleted the fix_fingerprint branch October 2, 2019 15:58
@mliu49 mliu49 mentioned this pull request Dec 16, 2019
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.

Some molecules fail isomorphism check
2 participants