Skip to content

OpenMMEngine: use masses from mdtraj topolgy directly#1085

Merged
dwhswenson merged 2 commits into
openpathsampling:masterfrom
hejung:possible_fix_for_1084
Oct 29, 2021
Merged

OpenMMEngine: use masses from mdtraj topolgy directly#1085
dwhswenson merged 2 commits into
openpathsampling:masterfrom
hejung:possible_fix_for_1084

Conversation

@hejung

@hejung hejung commented Oct 28, 2021

Copy link
Copy Markdown
Contributor

This avoids the error raised by the fact that virtual sites have no element associated with them in openMM by taking the mdtraj topology directly. From our discussion in #1084 I gathered that using the mdtraj masses directly would be an acceptable solution?

This avoids the situation in which we have to change the engine of the snapshots to be able to use the RandomVelocities modifier with virtual sites as in TIP4P. One should still pass a subset_mask in which the virtual sites are excluded and the OpenMMEngine as engine to be able to apply constraints to the RandomVelocities modifier on creation.

@codecov

codecov Bot commented Oct 28, 2021

Copy link
Copy Markdown

Codecov Report

Merging #1085 (ba944ae) into master (ea605e8) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1085   +/-   ##
=======================================
  Coverage   81.56%   81.56%           
=======================================
  Files         140      140           
  Lines       15451    15451           
=======================================
  Hits        12603    12603           
  Misses       2848     2848           
Impacted Files Coverage Δ
openpathsampling/engines/openmm/features/masses.py 100.00% <100.00%> (ø)

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 ea605e8...ba944ae. Read the comment docs.

@dwhswenson dwhswenson added the bugfix PRs fixing bugs label Oct 28, 2021

@dwhswenson dwhswenson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you add a small regression test? It looks like all you'd need is a PDB with a single TIP4P water from your example. Put that in tests/test_data/, load it up (use the tests.test_helpers.data_filename method to get the file location regardless of install method), and then pass it through this process. Test would go in tests/test_openmm_snapshot.py.

Otherwise, LGTM! Thanks!

@dwhswenson dwhswenson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Test looks good to me. Any other changes you're planning in this, @hejung, or is it ready to go?

@hejung

hejung commented Oct 29, 2021

Copy link
Copy Markdown
Contributor Author

@dwhswenson All ready to go.

Yesterday evening one if the tests failed in its setup phase and I had planed to check again today in the hope it would resolve itself, but you were faster than me :)
Edit: It just saw that it did not resolve itself, but by you triggering the tests again xD

@dwhswenson

Copy link
Copy Markdown
Member

Yeah, it looked like network connectivity was a little rough yesterday -- It took a couple of reruns to get it to work, but it's easy enough for me to just click the button!

Merging now; thanks for the bugfix!

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

Labels

bugfix PRs fixing bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants