Skip to content

ancestral: Implement --config - #2041

Open
victorlin wants to merge 5 commits into
victorlin/refine-configfrom
victorlin/ancestral-config
Open

ancestral: Implement --config#2041
victorlin wants to merge 5 commits into
victorlin/refine-configfrom
victorlin/ancestral-config

Conversation

@victorlin

@victorlin victorlin commented Aug 17, 2026

Copy link
Copy Markdown
Member

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

  • Automated checks pass
  • Check if you need to add a changelog message
  • Check if you need to add tests
  • Check if you need to update docs
  • PR nextstrain.org for schema route

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.
@victorlin victorlin self-assigned this Aug 17, 2026
@victorlin victorlin mentioned this pull request Aug 17, 2026
7 tasks
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.38%. Comparing base (c0e909f) to head (cf04a1a).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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
victorlin force-pushed the victorlin/ancestral-config branch from 84a4cf1 to cf04a1a Compare August 18, 2026 00:24
@jameshadfield jameshadfield mentioned this pull request Aug 18, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant