Skip to content

Commit

Permalink
Changed default behaviour to restart=False, warnings regarding overwr…
Browse files Browse the repository at this point in the history
…iting still exist.
  • Loading branch information
mb2055 committed Nov 6, 2023
1 parent 485ae5a commit d4faed6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/somd2/config/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(
max_gpus=None,
run_parallel=True,
output_directory="output",
restart=True,
restart=False,
write_config=True,
log_level="info",
log_file=None,
Expand Down
2 changes: 1 addition & 1 deletion tests/runner/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def test_dynamics_options():

# Instantiate a runner using the default config.
# (All default options, other than platform="cpu".)
runner = Runner(mols, Config(platform="cpu"))
runner = Runner(mols, Config(platform="cpu", output_directory=tmpdir))

# Initalise a fake simulation.
runner._initialise_simulation(runner._system.clone(), 0.0)
Expand Down
14 changes: 6 additions & 8 deletions tests/runner/test_restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,13 @@ def test_restart():

config_diffoutputdirectory = config_new.copy()
config_diffoutputdirectory["runtime"] = "36fs"
config_diffoutputdirectory["output_directory"] = "test"
with tempfile.TemporaryDirectory() as tmpdir2:
config_diffoutputdirectory["output_directory"] = tmpdir2

with pytest.raises(IndexError):
runner_outputdirectory = Runner(mols, Config(**config_diffoutputdirectory))
with pytest.raises(IndexError):
runner_outputdirectory = Runner(
mols, Config(**config_diffoutputdirectory)
)

config_diffperturbableconstraint = config_new.copy()
config_diffperturbableconstraint["runtime"] = "36fs"
Expand Down Expand Up @@ -174,8 +177,3 @@ def test_restart():

with pytest.raises(ValueError):
runner_swapendstates = Runner(mols, Config(**config_diffswapendstates))


if __name__ == "__main__":
test_restart()
print("test_restart.py: All tests passed.")

0 comments on commit d4faed6

Please sign in to comment.