8000 [WIP] Fix OpenMM Constraints by nividic · Pull Request #969 · ParmEd/ParmEd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[WIP] Fix OpenMM Constraints #969

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

Merged
merged 3 commits into from
Mar 21, 2018
Merged

[WIP] Fix OpenMM Constraints #969

merged 3 commits into from
Mar 21, 2018

Conversation

nividic
Copy link
@nividic nividic commented Mar 19, 2018

This is a fix for the issues: #958 and #959

@nividic nividic changed the title Fix OpenMM Constraints [ WIP] Fix OpenMM Constraints Mar 19, 2018
@nividic nividic changed the title [ WIP] Fix OpenMM Constraints [WIP] Fix OpenMM Constraints Mar 19, 2018
@nividic
Copy link
Author
nividic commented Mar 20, 2018

@swails I made a fix for the OpenMM Constraints in Parmed and all the tests are passed. The main goal of the patch was to fix the Parmed rigid water option that was not behaving correctly leaving the water partially flexible. In the patch, I still have some concerns related to cases where angle constraints could involve for example virtual sites. I wonder if you can comment on that and overall if you could have a look at the patch and have it merged. Thanks

Copy link
Contributor
@swails swails left a comment

Choose a reason for hiding this comment

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

Looks good. Just a few small changes.

constraint_angle_set = set()
is_water = _settler(self)

if constraints == app.AllBonds or constraints == app.HAngles:
Copy link
Contributor

Choose a reason for hiding this comment

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

app.AllBonds and app.HAngles are better thought of as enums (or singletons). Compare using is, not ==

if isinstance(bond.atom1, ExtraPoint): continue
if isinstance(bond.atom2, ExtraPoint): continue
constraint_bond_set.add(frozenset((bond.atom1.idx, bond.atom2.idx)))
elif constraints == app.HBonds:
Copy link
Contributor

Choose a reason for hiding this comment

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

== -> is


if constraints == app.HAngles:
Copy link
Contributor

Choose a reason for hiding this comment

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

== -> is

if rigidWater:
for angle in self.angles:
if is_water[angle.atom1.residue.idx]:
constraint_angle_set.add(frozenset((angle.atom1.idx,
Copy link
Contributor

Choose a reason for hiding this comment

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

Order matters here, doesn't it? So you can't use an unordered collection like set or frozenset. My guess is that it will usually work, but there may be instances where it'll fail.

@swails
Copy link
Contributor
swails commented Mar 21, 2018

Thanks! Looks good!

My one last comment is that the angle ordering now won't match the equivalent, but reversed ordering. However, since this one method constructs the set of constraints to add, and then adds them, from the same angles list, the reverse order will never be encountered. So it's still correct.

I'll merge this as-is.

@swails swails merged commit 537bdb1 into ParmEd:master Mar 21, 2018
@nividic
Copy link
Author
nividic commented Mar 21, 2018

Thank you so much,
Gaetano

@nividic
Copy link
Author
nividic commented Mar 21, 2018

@swails I'm sorry to bother you again, we would like to make a new conda package in the omnia repository. Would be possible for you to update the Parmed point release to 2.7.4. Thanks a lot

@davidlmobley
Copy link
Contributor

To be specific, we're using this on a cloud computing platform where (for practical purposes) we can't use software that isn't available as a conda-installable point release, and having a bug where we accidentally end up with semi-flexible water is obviously not a good way for us to successfully run our calculations. So we can't proceed until we have a new point release (we can update the conda recipe to reflect the new release).

@swails
Copy link
Contributor
swails commented Mar 21, 2018

Done and tagged. I think all that needs to be done is someone has to update the conda-recipes repo where the recipe for ParmEd lives.

@swails
Copy link
Contributor
swails commented Mar 21, 2018

It's now pip-installable as version 3.0.1 as well, which should help workaround any delays in conda-availability

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
0