Skip to content

Allow override/removal of default clock_rate params from a custom config overlay #44

Description

@j23414

Context

This was flagged during a dengue PR for setting a fixed clock_rate in nextstrain/dengue#123 (comment)

When using an overlay config to override/remove the default config for clock_rate:

refine:
  clock_rate:
    all:
      genome: null  # To override/remove the default param

The current behavior is that null is not equal to "" and will result in a strange clock rate flag

nextstrain build . auspice/dengue_all_genome.json -np | grep refine
# --clock-rate None

Checking against None fixes this behavior such that there is no --clock-rate flag whatsoever.

Description

Add the same change as nextstrain/dengue@411afae

Change:

clock_rate = config['refine']['clock_rate'].get(wildcards.group, {}).get(wildcards.gene, "")
if clock_rate !="":
return f' --clock-rate {clock_rate} '
else:
return ""

To:

 clock_rate = config['refine']['clock_rate'].get(wildcards.group, {}).get(wildcards.gene, None) 
 if clock_rate is not None: 
     return f' --clock-rate {clock_rate} ' 
 else: 
     return "" 

Examples

Possible solution

(Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions