-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1119 from openforcefield/write-itp
Optionally write GROMACS topologies as multiple `.itp` files
- Loading branch information
Showing
8 changed files
with
157 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"""Helpers for testing GROMACS interoperability.""" | ||
|
||
from openff.utilities import temporary_cd | ||
|
||
from openff.interchange import Interchange | ||
from openff.interchange.drivers import get_gromacs_energies | ||
|
||
|
||
def gmx_monolithic_vs_itp(state: Interchange): | ||
with temporary_cd(): | ||
get_gromacs_energies(state, _monolithic=True).compare(get_gromacs_energies(state, _monolithic=False)) | ||
|
||
# TODO: More helpful handling of failures, i.e. | ||
# * Detect differences in positions | ||
# * Detect differences in box vectors | ||
# * Detect differences in non-bonded settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
openff/interchange/_tests/interoperability_tests/gromacs/test_systems.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from openff.toolkit import Quantity | ||
|
||
from openff.interchange._tests._gromacs import gmx_monolithic_vs_itp | ||
|
||
|
||
def test_ligand_vacuum(caffeine, sage_unconstrained, monkeypatch): | ||
monkeypatch.setenv("INTERCHANGE_EXPERIMENTAL", "1") | ||
|
||
topology = caffeine.to_topology() | ||
topology.box_vectors = Quantity([4, 4, 4], "nanometer") | ||
|
||
gmx_monolithic_vs_itp(sage_unconstrained.create_interchange(topology)) | ||
|
||
|
||
def test_water_dimer(water_dimer, tip3p, monkeypatch): | ||
monkeypatch.setenv("INTERCHANGE_EXPERIMENTAL", "1") | ||
|
||
gmx_monolithic_vs_itp(tip3p.create_interchange(water_dimer)) | ||
|
||
|
||
def test_alanine_dipeptide(alanine_dipeptide, ff14sb, monkeypatch): | ||
monkeypatch.setenv("INTERCHANGE_EXPERIMENTAL", "1") | ||
|
||
gmx_monolithic_vs_itp(ff14sb.create_interchange(alanine_dipeptide)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters