ancestral: Implement --config - #2041
Open
victorlin wants to merge 5 commits into
Open
Conversation
Enables configuration via a YAML file in addition to CLI arguments. All options available in the CLI are also available in the YAML file, but an option cannot be set in both simultaneously. Updated help text to reference both CLI and YAML syntax, now that both are valid options. Implemented using a new dependency, ConfigArgParse. It handles the YAML configuration within argparse so that the rest of the code can continue referencing the values from argparse. Note that it doesn't make sense to use ConfigArgParse with augur subsample because the YAML config used in that command has a nested structure, opposed to the flat structure implicitly supported by the CLI. This commit just adds the functionality and a test. More to come in the following commits.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## victorlin/refine-config #2041 +/- ##
========================================================
Coverage 73.37% 73.38%
========================================================
Files 86 86
Lines 10822 10823 +1
Branches 2110 2110
========================================================
+ Hits 7941 7942 +1
Misses 2505 2505
Partials 376 376 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This will be useful as a basis for documentation, and validation by pathogen workflows. Done with a new script that inspects the argparse parser object so that all the logic and help text can stay in register_parser().
The schema by itself isn't very useful for users. A table describing the available options is much more decipherable. Luckily we already do something for augur subsample's config docs. I've generalized an existing helper function to work with any flat JSON schema.
Adds the --config option to augur ancestral using patterns from augur refine's --config option. Updated help text to reference both CLI and YAML syntax, now that both are valid options. Added code to handle enums in the schema generating script, since enums are used in ancestral and not refine.
victorlin
force-pushed
the
victorlin/ancestral-config
branch
from
August 18, 2026 00:24
84a4cf1 to
cf04a1a
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of proposed changes
Adds the --config option to augur ancestral using patterns from augur refine's --config option.
Updated help text to reference both CLI and YAML syntax, now that both are valid options.
Added code to handle enums in the schema generating script, since enums are used in ancestral and not refine.
Docs preview: https://nextstrain--2041.org.readthedocs.build/projects/augur/en/2041/usage/cli/ancestral.html#configuration
Related issue(s)
#1987
Checklist