Skip to content

Commit

Permalink
TST: Reproduce issue #1049
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Sep 17, 2024
1 parent 292faec commit 5553c0b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions openff/interchange/_tests/test_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,26 @@ def test_issue_1031(monkeypatch):
# check a few atom names to ensure these didn't end up being empty sets
for atom_name in ("NE2", "H3", "HA", "CH3", "CA", "CB", "CE1"):
assert atom_name in openff_atom_names


def test_issue_1049():
pytest.importorskip("openmm")

topology = Topology.from_molecules(
[
Molecule.from_smiles("C"),
Molecule.from_smiles("O"),
Molecule.from_smiles("O"),
],
)

interchange = ForceField("openff-2.2.0.offxml", "opc.offxml").create_interchange(topology)

openmm_topology = interchange.to_openmm_topology()
openmm_system = interchange.to_openmm_system()

# the same index in system should also be a virtual site in the topology
for particle_index, particle in enumerate(openmm_topology.atoms()):
assert openmm_system.isVirtualSite(particle_index) == (
particle.element is None
), f"particle index {particle_index} is a virtual site in the system OR topology but not both"

0 comments on commit 5553c0b

Please sign in to comment.