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

Dihedral rotator function #1039

Merged
merged 12 commits into from
Aug 22, 2022
Merged

Conversation

uppittu11
Copy link
Member

PR Summary:

Adds a function that allows you to rotate a proper dihedral angle in a compound about a specified central bond. This can be useful for setting up systems with specific molecular conformations and also for generating structures for obtaining dihedral free energies.

PR Checklist


  • Includes appropriate unit test(s)
  • Appropriate docstring(s) are added/updated
  • Code is (approximately) PEP8 compliant
  • Issue(s) raised/addressed?

@codecov
Copy link

codecov bot commented Jun 13, 2022

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.41%. Comparing base (f147795) to head (11b4721).
Report is 151 commits behind head on main.

Files Patch % Lines
mbuild/compound.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1039      +/-   ##
==========================================
+ Coverage   90.40%   90.41%   +0.01%     
==========================================
  Files          64       64              
  Lines        9036     9056      +20     
==========================================
+ Hits         8169     8188      +19     
- Misses        867      868       +1     

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

@@ -346,6 +346,19 @@ def test_rotate_around_z_away_from_origin(self, sixpoints):
before[:, 1], -1 * after[:, 1], atol=1e-16
) and np.allclose(before[:, 0], -1 * after[:, 0], atol=1e-16)

def test_rotate_dihedral(self, ethane):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should add a test with a less symmetric molecule than ethane. This is a better proof of concept that the atoms were translated properly, especially if we're dealing with a long molecule polymers.

Copy link
Member

@daico007 daico007 left a comment

Choose a reason for hiding this comment

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

Added one more unit test and seems like it's doing what I expect. LGTM!

Copy link
Contributor

@CalCraven CalCraven left a comment

Choose a reason for hiding this comment

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

Nice test implementation!

@daico007 daico007 merged commit f225d8e into mosdef-hub:main Aug 22, 2022
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.

4 participants