From 6ead6ec158fd9bd2d4e015926cbdddc70609d09a Mon Sep 17 00:00:00 2001 From: h-aze Date: Wed, 27 Sep 2023 19:45:53 +0100 Subject: [PATCH] Added to README and some bug fixes --- README.md | 1 + slune/savers.py | 5 +++-- slune/slune.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 634da1a..7a09030 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ So early I haven't even written the docs yet! Will be adding a quick example her ## Coming soon Currently very much in early stages, first things still to do: - Auto save when finished a tuning run. +- Auto sbatch job naming and job output naming. - Add ability to read results, currently can only submit jobs and log metrics during tuning. - Refine class structure, ie. subclassing, making sure classes have essential methods, what are the essential methods and attributes? etc. - Refine package structure and sort out github actions like test coverage, running tests etc. diff --git a/slune/savers.py b/slune/savers.py index 0b8c9f9..66561b1 100644 --- a/slune/savers.py +++ b/slune/savers.py @@ -31,8 +31,9 @@ def get_match(self, params): missing_params = [[p for p in params if sp in p][0] for sp in stripped_params if sp not in match] # Now we add back in the values we stripped out match = match.split('/') - match = [match[0]] + [[p for p in params if m in p][0] for m in match[1:]] - match = '/'.join(match) + if(len(match) > 1): + match = [match[0]] + [[p for p in params if m in p][0] for m in match[1:]] + match = '/'.join(match) # If there are missing arguments, add them to the path if len(missing_params) > 0: match = os.path.join(match, *missing_params) diff --git a/slune/slune.py b/slune/slune.py index 8adb36e..6e2dbad 100644 --- a/slune/slune.py +++ b/slune/slune.py @@ -13,8 +13,8 @@ def submit_job(sh_path, args): """ try: # Run the Bash script using subprocess - command = ['bash', sh_path] + args - subprocess.run(['sbatch', command], check=True) + command = [sh_path] + args + subprocess.run(['sbatch'] + command, check=True) except subprocess.CalledProcessError as e: print(f"Error running sbatch: {e}")