-
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 #909 from openforcefield/json-roundtrip-bugfixes
Do not ignore float/int in JSON input
- Loading branch information
Showing
5 changed files
with
57 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Energy tests directly related to the SMIRNOFF submodule.""" |
27 changes: 27 additions & 0 deletions
27
openff/interchange/_tests/energy_tests/smirnoff/test_base.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,27 @@ | ||
from openff.toolkit import Quantity | ||
from openff.utilities.testing import skip_if_missing | ||
|
||
from openff.interchange import Interchange | ||
from openff.interchange._tests import MoleculeWithConformer, needs_gmx | ||
from openff.interchange.drivers import get_gromacs_energies, get_openmm_energies | ||
|
||
|
||
@needs_gmx | ||
@skip_if_missing("openmm") | ||
def test_issue_908(sage_unconstrained): | ||
molecule = MoleculeWithConformer.from_smiles("ClCCl") | ||
topology = molecule.to_topology() | ||
topology.box_vectors = Quantity([4, 4, 4], "nanometer") | ||
|
||
state1 = sage_unconstrained.create_interchange(topology) | ||
|
||
with open("test.json", "w") as f: | ||
f.write(state1.json()) | ||
|
||
state2 = Interchange.parse_file("test.json") | ||
|
||
get_gromacs_energies(state1).compare(get_gromacs_energies(state2)) | ||
get_openmm_energies( | ||
state1, | ||
combine_nonbonded_forces=False, | ||
).compare(get_openmm_energies(state2, combine_nonbonded_forces=False)) |
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