Skip to content

Commit

Permalink
Add alchemical ion test system with existing ions.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Aug 13, 2024
1 parent c2f08f5 commit c060577
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,10 @@ def ethane_methanol_hmr():
mols = sr.load(sr.expand(sr.tutorial_url, "merged_molecule_hmr.s3"))
mols = sr.morph.link_to_reference(mols)
return mols


@pytest.fixture(scope="session")
def ethane_methanol_ions():
mols = sr.load(sr.expand(sr.tutorial_url, "merged_molecule_ions.s3"))
mols = sr.morph.link_to_reference(mols)
return mols
6 changes: 4 additions & 2 deletions tests/runner/test_alchemical_ions.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import math
import pytest

from somd2.runner import Runner


def test_alchemical_ions(ethane_methanol):
@pytest.mark.parametrize("mols", ["ethane_methanol", "ethane_methanol_ions"])
def test_alchemical_ions(mols, request):
"""Ensure that alchemical ions are added correctly."""

# Clone the system.
mols = ethane_methanol.clone()
mols = request.getfixturevalue(mols).clone()

# Add 10 Cl- ions.
new_mols = Runner._create_alchemical_ions(mols, 10)
Expand Down

0 comments on commit c060577

Please sign in to comment.