Skip to content

Commit

Permalink
Follow three step behavior for setting clade_recency
Browse files Browse the repository at this point in the history
Per rationale in issue 1131 (#1131), switch to following a three step look up for setting build-specific parameters of colors:clade_recency.
  • Loading branch information
trvrb committed Jul 26, 2024
1 parent 61bcb1a commit 1fd29e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion workflow/snakemake_rules/common.smk
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,15 @@ def _get_metadata_by_wildcards(wildcards):
return _get_metadata_by_build_name(wildcards.build_name)

def _get_clade_recency_for_wildcards(wildcards):
# check if builds.yaml contains colors:{build_name}:clade_recency
if wildcards.build_name in config["colors"] and 'clade_recency' in config["colors"][wildcards.build_name]:
return config["colors"][wildcards.build_name]["clade_recency"]
# check if builds.yaml or parameters.yaml contains colors:clade_recency
elif "colors" in config and "clade_recency" in config["colors"]:
return config["colors"]["clade_recency"]
# else return sensible default value
else:
return config["colors"]["default"]["clade_recency"]
return ""

def _get_trait_columns_by_wildcards(wildcards):
if wildcards.build_name in config["traits"]:
Expand Down

0 comments on commit 1fd29e4

Please sign in to comment.