diff --git a/Snakefile b/Snakefile index a59025f9..0bb1b665 100644 --- a/Snakefile +++ b/Snakefile @@ -30,7 +30,6 @@ if run["name"]: else: RDIR = "" -# for possibly shared resources logs = path_provider("logs/", RDIR, run["shared_resources"]) benchmarks = path_provider("benchmarks/", RDIR, run["shared_resources"]) resources = path_provider("resources/", RDIR, run["shared_resources"]) @@ -38,14 +37,6 @@ resources = path_provider("resources/", RDIR, run["shared_resources"]) CDIR = "" if run["shared_cutouts"] else RDIR RESULTS = "results/" + RDIR -# TODO: this needs to be aligned with new scenario management -# if not (shared_resources := run.get("shared_resources")): -# RESOURCES = "resources/" + RDIR -# elif isinstance(shared_resources, str): -# RESOURCES = "resources/" + shared_resources + "/" -# else: -# RESOURCES = "resources/" - localrules: purge, diff --git a/scripts/_helpers.py b/scripts/_helpers.py index f1c659ec..06e68325 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -321,7 +321,7 @@ def progress_retrieve(url, file, disable=False): def mock_snakemake( rulename, root_dir=None, - configfiles=[], + configfiles=None, submodule_dir="workflow/submodules/pypsa-eur", **wildcards, ): @@ -375,7 +375,9 @@ def mock_snakemake( if os.path.exists(p): snakefile = p break - if isinstance(configfiles, str): + if configfiles is None: + configfiles = [] + elif isinstance(configfiles, str): configfiles = [configfiles] workflow = sm.Workflow( @@ -397,7 +399,7 @@ def mock_snakemake( def make_accessable(*ios): for io in ios: - for i in range(len(io)): + for i, _ in enumerate(io): io[i] = os.path.abspath(io[i]) make_accessable(job.input, job.output, job.log)