From 73b974458bd91eca90d9896022a9a37424a3a01d Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Fri, 7 Jul 2023 15:27:16 +0200 Subject: [PATCH] fix: job_id is an int --- slate/slate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/slate/slate.py b/slate/slate.py index 998f0fe..6d2978a 100644 --- a/slate/slate.py +++ b/slate/slate.py @@ -124,13 +124,15 @@ class Slate(): def _reps_for_job(self, schedulerC, job_id): reps = schedulerC.get('repetitions', 1) + if job_id == None: + return range(0, reps) num_jobs = self._calc_num_jobs(schedulerC) reps_for_job = [[]] * num_jobs for i in range(reps): reps_for_job[i % num_jobs].append(i) return reps_for_job[job_id] - def run_local(self, filename, name, job_id=0): + def run_local(self, filename, name, job_id): config = self.load_config(filename, name) schedulerC = copy.deepcopy(config.get('scheduler', {})) rep_ids = self._reps_for_job(schedulerC, job_id) @@ -245,7 +247,7 @@ class Slate(): parser.add_argument("experiment", nargs='?', default='DEFAULT') parser.add_argument("-s", "--slurm", action="store_true") parser.add_argument("-w", "--worker", action="store_true") - parser.add_argument("-j", "--job_id", default=0) + parser.add_argument("-j", "--job_id", default=None, type=int) args = parser.parse_args()