Skip to content

Commit

Permalink
Use ethane~methanol perturbation and reference platform.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Oct 14, 2024
1 parent d4e8c2d commit c58fc13
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/convert/test_openmm_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,31 +458,31 @@ def test_auto_constraints(ala_mols, openmm_platform):
"openmm" not in sr.convert.supported_formats(),
reason="openmm support is not available",
)
@pytest.mark.skipif(platform.system() != "Linux", reason="Minimisation is platform dependent")
def test_asymmetric_constraints():
def test_asymmetric_constraints(merged_ethane_methanol):
# Test that constraints are updated correctly when the end states have
# different constraints.

from math import isclose
from openmm import XmlSerializer
from tempfile import NamedTemporaryFile

# Load the MCL1 perturbation. (Perturbable ligand is the last molecule.)
mol = sr.load_test_files("mcl1_60_61.s3")[-1]
# Extract the molecule.
mol = merged_ethane_methanol.clone()[0]
mol = sr.morph.link_to_reference(mol)

# Create dynamics objects for the forward and backward perturbations.
d_forwards = mol.dynamics(
perturbable_constraint="h_bonds_not_heavy_perturbed",
dynamic_constraints=True,
include_constrained_energies=False,
platform="CPU",
platform="Reference",
)
d_backwards = mol.dynamics(
perturbable_constraint="h_bonds_not_heavy_perturbed",
include_constrained_energies=False,
dynamic_constraints=True,
swap_end_states=True,
platform="CPU",
platform="Reference",
)

# Set lambda so the dynamics states are equivalent.
Expand Down Expand Up @@ -521,4 +521,4 @@ def test_asymmetric_constraints():
nrg_backwards = d_backwards.current_potential_energy().value()

# Check the minimised potential energies are the same. (Post constraint projection.)
assert isclose(nrg_forwards, nrg_backwards, rel_tol=1e-1)
assert isclose(nrg_forwards, nrg_backwards, rel_tol=1e-4)

0 comments on commit c58fc13

Please sign in to comment.