From b28b9378c152ee1f903e8a5b859f986a284ba69a Mon Sep 17 00:00:00 2001 From: Yuman Hordijk Date: Mon, 3 Jun 2024 13:24:20 +0200 Subject: [PATCH] Now looking in the workdir instead of rundir to remove files. Also removing some more files now related to failed jobs --- src/tcutility/job/ams.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tcutility/job/ams.py b/src/tcutility/job/ams.py index afa3bbfa..4b0c9812 100644 --- a/src/tcutility/job/ams.py +++ b/src/tcutility/job/ams.py @@ -180,10 +180,19 @@ def _setup_job(self): ''' os.makedirs(self.rundir, exist_ok=True) - for file in os.listdir(self.rundir): - p = os.path.join(self.rundir, file) + # clean the workdir if it contains files + for file in os.listdir(self.workdir): + p = os.path.join(self.workdir, file) if p.endswith('.rkf'): os.remove(p) + if 'ams.kid' in p: + os.remove(p) + if p.startswith('t21.'): + os.remove(p) + if p.startswith('t12.'): + os.remove(p) + + if not self._molecule and not self._molecule_path and 'atoms' not in self.settings.input.ams.system: log.error(f'You did not supply a molecule for this job. Call the {self.__class__.__name__}.molecule method to add one.')