From 05a3c43c30bd82a20f2c50f5a901a26cad2da6a6 Mon Sep 17 00:00:00 2001 From: Philipp Glaum Date: Wed, 10 Apr 2024 12:23:28 +0200 Subject: [PATCH] move prefix from Snakefile to get_dir function --- Snakefile | 8 +------- scripts/_helpers.py | 5 +++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Snakefile b/Snakefile index ed60c0f5..ba93a869 100644 --- a/Snakefile +++ b/Snakefile @@ -22,13 +22,7 @@ configfile: "config/config.yaml" run = config["run"] scenarios = get_scenarios(run) -prefix = run.get("prefix", "") -rdir = get_rdir(run) - -if prefix: - RDIR = f"{prefix}/{rdir}" -else: - RDIR = rdir +RDIR = get_rdir(run) logs = path_provider("logs/", RDIR, run["shared_resources"]) benchmarks = path_provider("benchmarks/", RDIR, run["shared_resources"]) diff --git a/scripts/_helpers.py b/scripts/_helpers.py index 64ccab87..dfedcaea 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -59,6 +59,11 @@ def get_rdir(run): RDIR = run["name"] + "/" else: RDIR = "" + + prefix = run.get("prefix", "") + if prefix: + RDIR = f"{prefix}/{RDIR}" + return RDIR