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

Convert "Quantity" to raw value for kinetic_energy and potential_energy in OpenMM reader #4548

Merged
merged 4 commits into from
Mar 31, 2024

Conversation

orionarcher
Copy link
Contributor

@orionarcher orionarcher commented Mar 30, 2024

Changes made in this Pull Request:

  • added .value to kinetic_energy and potential_energy

This is breaking the ability of a downstream MDAkit to write H5MD files. Issue here. I suspect it is more generally breaking the ability to take in OpenMM and output H5MD, but it is only in openmm-reporter that I came across it.

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Developers certificate of origin


📚 Documentation preview 📚: https://mdanalysis--4548.org.readthedocs.build/en/4548/

Copy link

github-actions bot commented Mar 30, 2024

Linter Bot Results:

Hi @orionarcher! Thanks for making this PR. We linted your code and found the following:

Some issues were found with the formatting of your code.

Code Location Outcome
main package ⚠️ Possible failure
testsuite ✅ Passed

Please have a look at the darker-main-code and darker-test-code steps here for more details: https://github.com/MDAnalysis/mdanalysis/actions/runs/8495207361/job/23271241401


Please note: The black linter is purely informational, you can safely ignore these outcomes if there are no flake8 failures!

Copy link

codecov bot commented Mar 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.64%. Comparing base (a2a27aa) to head (54e5664).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4548      +/-   ##
===========================================
- Coverage    93.66%   93.64%   -0.03%     
===========================================
  Files          168      180      +12     
  Lines        21248    22327    +1079     
  Branches      3917     3917              
===========================================
+ Hits         19902    20908    +1006     
- Misses         888      961      +73     
  Partials       458      458              

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

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

Thanks, just the one thing please.

@@ -125,10 +125,10 @@ def _mda_timestep_from_omm_context(self):
ts.frame = 0
ts.data["time"] = state.getTime()._value
ts.data["potential_energy"] = (
state.getPotentialEnergy().in_units_of(u.kilojoule/u.mole)
state.getPotentialEnergy().in_units_of(u.kilojoule/u.mole)._value
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to add a quick test for these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@pep8speaks
Copy link

pep8speaks commented Mar 31, 2024

Hello @orionarcher! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-03-31 02:35:28 UTC

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

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

lgtm!

@IAlibay IAlibay merged commit 93630da into MDAnalysis:develop Mar 31, 2024
21 of 23 checks passed
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.

3 participants