Skip to content

Commit 190500b

Browse files
authored
feat: add wildcards to output and comment (#35)
Add rule wildcards to slurm output logs and job comments. Not sure if this will need extra checks for when `job` is a group instead of a rule.
1 parent 1922611 commit 190500b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

snakemake_executor_plugin_slurm/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,14 @@ def run_job(self, job: JobExecutorInterface):
6767

6868
log_folder = f"group_{job.name}" if job.is_group() else f"rule_{job.name}"
6969

70-
slurm_logfile = os.path.abspath(f".snakemake/slurm_logs/{log_folder}/%j.log")
70+
try:
71+
wildcard_str = f"_{'_'.join(job.wildcards)}" if job.wildcards else ""
72+
except AttributeError:
73+
wildcard_str = ""
74+
75+
slurm_logfile = os.path.abspath(
76+
f".snakemake/slurm_logs/{log_folder}/%j{wildcard_str}.log"
77+
)
7178
os.makedirs(os.path.dirname(slurm_logfile), exist_ok=True)
7279

7380
# generic part of a submission string:

0 commit comments

Comments
 (0)