Skip to content

Commit

Permalink
Enable replica exchange by default (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBoothroyd authored Dec 23, 2021
1 parent e327cc9 commit dedb2b6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion absolv/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class EquilibriumProtocol(BaseModel):
)

sampler: Literal["independent", "repex"] = Field(
"independent",
"repex",
description="The mode in which to sample each of the different lambda states.",
)

Expand Down
2 changes: 2 additions & 0 deletions absolv/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def argon_eq_schema():
),
lambda_sterics=[1.0, 0.5, 0.0],
lambda_electrostatics=[0.0, 0.0, 0.0],
sampler="independent",
),
alchemical_protocol_b=EquilibriumProtocol(
minimization_protocol=None,
Expand All @@ -292,6 +293,7 @@ def argon_eq_schema():
),
lambda_sterics=[1.0, 0.0],
lambda_electrostatics=[1.0, 1.0],
sampler="independent",
),
)

Expand Down
13 changes: 10 additions & 3 deletions absolv/tests/test_simulations.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def alchemical_argon_eq_simulation(alchemical_argon_system):
n_iterations=1, n_steps_per_iteration=1
),
production_protocol=SimulationProtocol(n_iterations=1, n_steps_per_iteration=1),
sampler="independent",
)

simulation = EquilibriumOpenMMSimulation(
Expand Down Expand Up @@ -268,7 +269,9 @@ def test_init(self, alchemical_argon_system):
topology, coordinates, system = alchemical_argon_system

protocol = EquilibriumProtocol(
lambda_sterics=[1.0, 0.0], lambda_electrostatics=[1.0, 1.0]
lambda_sterics=[1.0, 0.0],
lambda_electrostatics=[1.0, 1.0],
sampler="independent",
)

simulation = EquilibriumOpenMMSimulation(
Expand Down Expand Up @@ -395,7 +398,9 @@ def test_init(self, alchemical_argon_system):
topology, coordinates, system = alchemical_argon_system

protocol = EquilibriumProtocol(
lambda_sterics=[1.0, 0.0], lambda_electrostatics=[1.0, 1.0]
lambda_sterics=[1.0, 0.0],
lambda_electrostatics=[1.0, 1.0],
sampler="independent",
)

simulation = AlchemicalOpenMMSimulation(
Expand Down Expand Up @@ -430,7 +435,9 @@ def test_begin_end_iteration(self):
topology.box_vectors,
State(temperature=3.0 * unit.kelvin, pressure=None),
EquilibriumProtocol(
lambda_sterics=[1.0, 0.0], lambda_electrostatics=[1.0, 1.0]
lambda_sterics=[1.0, 0.0],
lambda_electrostatics=[1.0, 1.0],
sampler="independent",
),
0,
"CPU",
Expand Down

0 comments on commit dedb2b6

Please sign in to comment.