diff --git a/src/somd2/config/_config.py b/src/somd2/config/_config.py index 91505c5..6223b00 100644 --- a/src/somd2/config/_config.py +++ b/src/somd2/config/_config.py @@ -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, diff --git a/tests/runner/test_config.py b/tests/runner/test_config.py index 6d594eb..a0af022 100644 --- a/tests/runner/test_config.py +++ b/tests/runner/test_config.py @@ -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) diff --git a/tests/runner/test_restart.py b/tests/runner/test_restart.py index 0065246..e53829c 100644 --- a/tests/runner/test_restart.py +++ b/tests/runner/test_restart.py @@ -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" @@ -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.")