From a5ddfaa5257beafb5fdce28d96e6ae1e574ee9fe Mon Sep 17 00:00:00 2001 From: michelwi Date: Thu, 16 May 2024 10:52:24 +0200 Subject: [PATCH] move setting up job after move into manager (#187) --- sisyphus/job.py | 6 +----- sisyphus/manager.py | 3 +++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sisyphus/job.py b/sisyphus/job.py index b8d38f3..d016d6e 100644 --- a/sisyphus/job.py +++ b/sisyphus/job.py @@ -195,7 +195,6 @@ def __new__(cls: Type[T], *args, **kwargs) -> T: # Init def _sis_init(self, args, kwargs, parsed_args): - for key, arg in parsed_args.items(): if isinstance(arg, Job): logging.warning( @@ -793,7 +792,7 @@ def _sis_print_error(self, tasks=1, lines=0): task.print_error(lines) def _sis_move(self) -> None: - """Move job directory a side and set up a new one""" + """Move job directory aside""" path = self._sis_path() i = 1 while os.path.isdir("%s.cleared.%04i" % (path, i)): @@ -801,9 +800,6 @@ def _sis_move(self) -> None: trash_path = "%s.cleared.%04i" % (path, i) logging.info("Move: %s to %s" % (path, trash_path)) os.rename(path, trash_path) - self._sis_setup_directory() - for t in self._sis_tasks(): - t.reset_cache() def _sis_delete(self) -> None: """Delete job directory""" diff --git a/sisyphus/manager.py b/sisyphus/manager.py index e93345a..749daf3 100644 --- a/sisyphus/manager.py +++ b/sisyphus/manager.py @@ -247,6 +247,9 @@ def clear_states(self, state=gs.STATE_ERROR): for job in self.jobs[state]: logging.warning("Clearing: %s" % job) job._sis_move() + job._sis_setup_directory() + for t in job._sis_tasks(): + t.reset_cache() job_cleared = True self.update_jobs() return job_cleared