Skip to content

Commit

Permalink
More GROMACS tests (#144)
Browse files Browse the repository at this point in the history
Adds a test reading a GROMACS system with bond and angle terms.
Adds tests of the include_path functionality for topologies.
Removes an unneeded exception class.
  • Loading branch information
ptmerz committed Apr 28, 2021
1 parent 02f66b6 commit f380afe
Show file tree
Hide file tree
Showing 14 changed files with 13,006 additions and 16 deletions.
30 changes: 30 additions & 0 deletions physical_validation/tests/test_data_gromacs_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,36 @@ def test_gromacs_and_flat_file_parsers_are_equivalent(ensemble: str) -> None:
)
assert simulation_data_gromacs_last_frame == simulation_data_flat_last_frame

@staticmethod
def test_gromacs_topology_exception() -> None:
r"""
Check that the GROMACS parser raises an exception when a topology
include cannot be found.
"""
system_name = "Octanol512"
parser = pv.data.GromacsParser()
gromacs_files = database.gromacs_files(system_name)["GasPhase"]
with pytest.raises(IOError):
parser.get_simulation_data(
mdp=gromacs_files["parameters"], top=gromacs_files["topology"]
)

@staticmethod
def test_gromacs_topology_with_bonds() -> None:
r"""
Check that GROMACS parser reads a system with bonds and angle
terms correctly.
"""
system_name = "Octanol512"
system = database.system(system_name)
gromacs_files = database.gromacs_files(system_name)["GasPhase"]

parser = pv.data.GromacsParser(includepath=gromacs_files["include_path"])
simulation_data = parser.get_simulation_data(
mdp=gromacs_files["parameters"], top=gromacs_files["topology"]
)
assert simulation_data.system == system.system_data

@staticmethod
def run_gromacs_simulation(
mdp_file: str, top_file: str, conf_file: str, deffnm: str
Expand Down
Empty file.
Loading

0 comments on commit f380afe

Please sign in to comment.