From 10bca6047a19372a9cad6e409cda041e2dd4d35b Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Thu, 14 Sep 2023 11:25:41 -0700 Subject: [PATCH] Standardize usage of Snakemake's "config" variable Checking presence of a key in the config should be done with the membership operator. --- Snakefile | 2 +- ingest/Snakefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Snakefile b/Snakefile index 0430647..cdd77ab 100644 --- a/Snakefile +++ b/Snakefile @@ -25,7 +25,7 @@ include: "workflow/snakemake_rules/glycosylation.smk" include: "workflow/snakemake_rules/clades.smk" -if config.get("deploy_url"): +if "deploy_url" in config: include: "workflow/snakemake_rules/nextstrain_automation.smk" rule clean: diff --git a/ingest/Snakefile b/ingest/Snakefile index 63d6972..6ebe391 100644 --- a/ingest/Snakefile +++ b/ingest/Snakefile @@ -25,7 +25,7 @@ def _get_all_targets(wildcards): ) elif len(remote_file_names) != len(set(remote_file_names)): print(f"Skipping file upload for {target!r} because there are duplicate remote file names.") - elif not config.get("s3_dst"): + elif "s3_dst" not in config: print(f"Skipping file upload for {target!r} because the destintion was not defined.") else: all_targets.extend(