Skip to content

Commit

Permalink
Add barostat testing
Browse files Browse the repository at this point in the history
  • Loading branch information
IAlibay committed Dec 24, 2023
1 parent 9bdd27f commit cb608a5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions openfe/tests/protocols/test_openmmutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,30 @@ def test_system_generator_nosolv_nocache(self, get_settings):

def test_system_generator_solv_cache(self, get_settings):
ffsets, thermosets, systemsets, intsets = get_settings

thermosets.temperature = 320 * unit.kelvin
thermosets.pressure = 1.25 * unit.bar
intsets.barostat_frequency = 200 * unit.timestep
generator = system_creation.get_system_generator(
ffsets, thermosets, intsets, systemsets, Path('./db.json'), True
)

# Check barostat conditions
assert isinstance(generator.barostat, MonteCarloBarostat)

pressure = ensure_quantity(
generator.barostat.getDefaultPressure(), 'openff',
)
temperature = ensure_quantity(
generator.barostat.getDefaultTemperature(), 'openff',
)
assert pressure.m == pytest.approx(1.25)
assert pressure.units == unit.bar
assert temperature.m == pytest.approx(320)
assert temperature.units == unit.kelvin
assert generator.barostat.getFrequency() == 200

# Check cache file
assert generator.template_generator._cache == 'db.json'

def test_get_omm_modeller_complex(self, T4_protein_component,
Expand Down

0 comments on commit cb608a5

Please sign in to comment.