Skip to content

Commit

Permalink
Standardize usage of Snakemake's "config" variable
Browse files Browse the repository at this point in the history
Checking presence of a key in the config should be done with the
membership operator.
  • Loading branch information
victorlin committed Sep 14, 2023
1 parent bd47210 commit 10bca60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ingest/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 10bca60

Please sign in to comment.