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

Improve testing of GROMACS import #1118

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Conversation

mattwthompson
Copy link
Member

Description

  • Add more tests importing GROMACS files
  • Look into constraint estimation

Checklist

  • Add tests
  • Lint
  • Update docstrings

Copy link

codecov bot commented Dec 3, 2024

Codecov Report

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

Project coverage is 93.77%. Comparing base (271caed) to head (0f555fa).
Report is 7 commits behind head on main.

Additional details and impacted files

@mattwthompson mattwthompson force-pushed the more-gromacs-import-tests branch from 92e6e3a to 29acdc0 Compare December 4, 2024 17:45
@mattwthompson
Copy link
Member Author

This could be ramped up a bit by running each of these tests as monolithic vs ITP structure

@mattwthompson mattwthompson marked this pull request as ready for review December 9, 2024 15:53
Comment on lines 10 to 12
def gmx_roundtrip(state: Interchange, apply_smirnoff_defaults: bool = False):
with temporary_cd():
state.to_gromacs(prefix="state", decimal=8)
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
def gmx_roundtrip(state: Interchange, apply_smirnoff_defaults: bool = False):
with temporary_cd():
state.to_gromacs(prefix="state", decimal=8)
@pytest.mark.parametrize("monolithic", [False, True])
def gmx_roundtrip(state: Interchange, apply_smirnoff_defaults: bool = False, monolithic):
with temporary_cd():
state.to_gromacs(prefix="state", decimal=8, monolithic=monolithic)

Intended change in #1120 after this is merged in

@j-wags j-wags self-assigned this Jan 13, 2025
Copy link
Member

@j-wags j-wags left a comment

Choose a reason for hiding this comment

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

LGTM, one nonblocking suggestion on a slightly confusing test method but otherwise good to go!

from openff.interchange.drivers import get_gromacs_energies


def gmx_monolithic_vs_itp(state: Interchange):
def gmx_roundtrip(state: Interchange, apply_smirnoff_defaults: bool = False):
Copy link
Member

Choose a reason for hiding this comment

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

(not blocking) My understanding of this method is that it just ensures that an error isn't raised when writing and then reading the system in GROMACS formats. It doesn't evaluate anything numerical or return the roundtripped system for further inspection. This was a little confusing to me, it might be good to update the method name or docstring to make that clear.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good find, I think that was incidentally removed in a merge

openff/interchange/_tests/__init__.py Show resolved Hide resolved
@mattwthompson mattwthompson marked this pull request as draft January 14, 2025 20:05
@mattwthompson mattwthompson marked this pull request as ready for review January 14, 2025 21:40
@mattwthompson mattwthompson merged commit 6a515c0 into main Jan 15, 2025
23 checks passed
@mattwthompson mattwthompson deleted the more-gromacs-import-tests branch January 15, 2025 14:09
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.

2 participants