Skip to content

Commit

Permalink
feat: add wildcards to output and comment (#35)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ulthran committed Feb 29, 2024
1 parent 1922611 commit 190500b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion snakemake_executor_plugin_slurm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,14 @@ def run_job(self, job: JobExecutorInterface):

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

slurm_logfile = os.path.abspath(f".snakemake/slurm_logs/{log_folder}/%j.log")
try:
wildcard_str = f"_{'_'.join(job.wildcards)}" if job.wildcards else ""
except AttributeError:
wildcard_str = ""

slurm_logfile = os.path.abspath(
f".snakemake/slurm_logs/{log_folder}/%j{wildcard_str}.log"
)
os.makedirs(os.path.dirname(slurm_logfile), exist_ok=True)

# generic part of a submission string:
Expand Down

0 comments on commit 190500b

Please sign in to comment.