Skip to content

Commit

Permalink
Backport fix from PR #190. [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Oct 24, 2023
1 parent d3c87c2 commit 7b80ccf
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions python/BioSimSpace/Sandpit/Exscientia/Solvent/_solvent.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def solvate(
ion_conc,
is_neutral,
is_aligned,
match_water,
work_dir,
property_map,
)
Expand Down
1 change: 1 addition & 0 deletions python/BioSimSpace/Solvent/_solvent.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def solvate(
ion_conc,
is_neutral,
is_aligned,
match_water,
work_dir,
property_map,
)
Expand Down
10 changes: 8 additions & 2 deletions tests/Sandpit/Exscientia/Solvent/test_solvent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest
import tempfile

from functools import partial

from sire.legacy.IO import GroTop

import BioSimSpace.Sandpit.Exscientia as BSS
Expand All @@ -18,8 +20,12 @@ def system():


@pytest.mark.parametrize("match_water", [True, False])
@pytest.mark.parametrize(
"function",
[partial(BSS.Solvent.solvate, "tip3p"), BSS.Solvent.tip3p],
)
@pytest.mark.skipif(not has_gromacs, reason="Requires GROMACS to be installed")
def test_crystal_water(system, match_water):
def test_crystal_water(system, match_water, function):
"""
Test that user defined crystal waters can be preserved during
solvation and on write to GroTop format.
Expand All @@ -35,7 +41,7 @@ def test_crystal_water(system, match_water):
box, angles = BSS.Box.cubic(5.5 * BSS.Units.Length.nanometer)

# Create the solvated system.
solvated = BSS.Solvent.tip3p(system, box, angles, match_water=match_water)
solvated = function(system, box, angles, match_water=match_water)

# Search for the crystal waters in the solvated system.
try:
Expand Down
10 changes: 8 additions & 2 deletions tests/Solvent/test_solvent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import pytest
import tempfile

from functools import partial

from sire.legacy.IO import GroTop

import BioSimSpace as BSS
Expand All @@ -18,8 +20,12 @@ def system():


@pytest.mark.parametrize("match_water", [True, False])
@pytest.mark.parametrize(
"function",
[partial(BSS.Solvent.solvate, "tip3p"), BSS.Solvent.tip3p],
)
@pytest.mark.skipif(not has_gromacs, reason="Requires GROMACS to be installed")
def test_crystal_water(system, match_water):
def test_crystal_water(system, match_water, function):
"""
Test that user defined crystal waters can be preserved during
solvation and on write to GroTop format.
Expand All @@ -35,7 +41,7 @@ def test_crystal_water(system, match_water):
box, angles = BSS.Box.cubic(5.5 * BSS.Units.Length.nanometer)

# Create the solvated system.
solvated = BSS.Solvent.tip3p(system, box, angles, match_water=match_water)
solvated = function(system, box, angles, match_water=match_water)

# Search for the crystal waters in the solvated system.
try:
Expand Down

0 comments on commit 7b80ccf

Please sign in to comment.