Skip to content

Commit

Permalink
Explicitly delete objects before tempfile cleanup to solve windows is…
Browse files Browse the repository at this point in the history
…sue?
  • Loading branch information
mb2055 committed Nov 8, 2023
1 parent 0d73e87 commit 845db4d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/somd2/runner/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,8 @@ def get_last_config(output_directory):
str(self._config.output_directory / "checkpoint_0.s3")
)
except:
_logger.error(
f"Unable to load checkpoint file from {self._config.output_directory}."
)
expdir = self._config.output_directory / "checkpoint_0.s3"
_logger.error(f"Unable to load checkpoint file from {expdir}.")
raise
else:
last_config = dict(system_temp.property("config"))
Expand Down
2 changes: 2 additions & 0 deletions tests/runner/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ def test_logfile_creation():
config = Config(output_directory=tmpdir, log_file="test.log")
assert config.log_file is not None
assert Path.exists(config.output_directory / config.log_file)
del config

# Instantiate a runner using the default config.
# (All default options, other than platform="cpu".)
runner = Runner(mols, Config(output_directory=tmpdir, log_file="test1.log"))
assert runner._config.log_file is not None
assert Path.exists(runner._config.output_directory / runner._config.log_file)
del runner

0 comments on commit 845db4d

Please sign in to comment.