Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass match_water parameter to specialised solvation functions #186

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
12 changes: 9 additions & 3 deletions tests/Sandpit/Exscientia/Solvent/test_solvent.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import pytest
import tempfile

from functools import partial

from sire.legacy.IO import GroTop

import BioSimSpace.Sandpit.Exscientia as BSS

from tests.Sandpit.Exscientia.conftest import has_gromacs
from tests.conftest import has_gromacs


@pytest.fixture(scope="module")
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
Loading