Configuration schema and validation - #139
Conversation
For consistency with other pathogen repos.
| conda_environment: | ||
| type: string |
There was a problem hiding this comment.
non-blocking
Just noticed this conda_environment param isn't used in the workflow at all. I wish there was a way for us to validate the schema against the workflow to flag things like this.
There was a problem hiding this comment.
Yeah, schema can get out of sync with actual usage. There are ways to programmatically find and track every usage of the config variable and compare that against the schema, but the complexity doesn't seem worthwhile.
I'll leave it as-is in this PR.
| resolutions: | ||
| all-time: | ||
| min_date: 1975-01-01 | ||
| min_date: "1975-01-01" |
There was a problem hiding this comment.
Date values in the default config file are explicitly quoted to avoid
being parsed into Python as date objects by Snakemake's YAML parser.
OH! That's good to know.
There was a problem hiding this comment.
It hasn't mattered so far because the date objects get translated back to the same YYYY-MM-DD strings in augur filter --min-date {params.min_date}.
In augur subsample, we explicitly parse date-like values into Python as strings.
Adds a YAML schema file for the structure of the current 'config' variable and uses it for validation on the variable at the start of the workflow. Date values in the default config file are explicitly quoted to avoid being parsed into Python as date objects by Snakemake's YAML parser.
f154019 to
5433a62
Compare
Description of proposed changes
Adds a YAML schema file for the structure of the current 'config' variable and uses it for validation on the variable at the start of the workflow.
Date values in the default config file are explicitly quoted to avoid being parsed into Python as date objects by Snakemake's YAML parser.
Related issue(s)
nextstrain/public#46
Checklist