-
Notifications
You must be signed in to change notification settings - Fork 81
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
Remove rigid body data structure from Compound
#1203
Conversation
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.
One small change, then we have to see why the 3.10 test is failing
@@ -123,10 +123,9 @@ def sixpoints(self): | |||
return molecule | |||
|
|||
@pytest.fixture | |||
def rigid_benzene(self): | |||
def benzene(self): |
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.
I think there's already a benzene in line 27. I would remove that once, as it is from smiles, and keep this mol2 version.
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.
Removing the benzene from SMILES was causing one of the coarse-graining parmed residue tests to fail (def test_resnames_parmed_cg
). I added the fixture back but renamed it so that it's clear it is being loaded from SMILES. I'm not sure why loading it from SMILES was giving different behavior for this test. Might be worth looking at later.
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.
yeah, this is because RDKIT is what we're using for the from_smiles method, and there is some stochastic nature involved in getting the atomic positions. I think since rdkit is more interested in the chemical connectivity and happy to get a reasonable ground state, but that ground state could be rotated in different ways. Although smiles are really easy to load up for mBuild tests, that one property means that things tend to be less flaky if we just load from a mol2 file.
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.
Yeah that's true, but unless I'm mistaken, I don't think that specific test (test_resnames_parmed_cg
) depends on having consistent atomic positions. It's just creating coarse grain compounds from atomistic compounds.
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.
Oh so you're saying it's not flaky, it just fails for the mol2 benzene and passes for the smiles benzene? In that case,I think it's the hierarchy, since that can certainly differ based on the information available in those two different formats.
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.
Yeah, this doesn't seem to be a flaky test, but related to how hierarchy is set.
@Zeerakkhan47 I know we discussed having you attempt to make this PR on the last dev meeting, but we felt it was important to get this one done before the 1.0 release, so I wanted to get it done ASAP. Please feel free to review the changes and raise any issues or questions! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1203 +/- ##
==========================================
- Coverage 87.35% 85.73% -1.63%
==========================================
Files 62 53 -9
Lines 6588 4802 -1786
==========================================
- Hits 5755 4117 -1638
+ Misses 833 685 -148 ☔ View full report in Codecov by Sentry. |
PR Summary:
@CalCraven and I have recently been removing the writers from mBuild now that most of them are in GMSO, and during that time some discussion came up about how to handle rigid bodies. Should we keep them in mBuild then read them into GMSO when converting from a compound to a topology, or should all rigid body assignment and handling only be done in GMSO? The only use case for rigid bodies in mBuild were in the HOOMD related writers, and now that they live exclusively in GMSO, we felt it was best to handle rigid body assignment purely in GMSO (See PR #850)
This PR completely removes the rigid body data structure and related methods from
compound.py
and any rigid body assignment done inconversion.py
PR Checklist