-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding CLI for prepare_data
and run_models
#50
base: main
Are you sure you want to change the base?
Conversation
Adding
|
Following up on #48 and #49, I'm adding a CLI interface for these two purposes.
Overview
This PR introduces a standardized command-line interface (CLI) for running evofr models, eliminating the need for per-project run-model.py scripts. The new CLI allows users to specify model configurations, data inputs, and inference settings via a YAML configuration file while also supporting command-line file overrides for input data.
Challenge
The biggest challenge for this CLI is that the required inputs vary across data classes, models, and inference methods. Some models require priors (e.g.,
InnovationMLR
), others need different types of sequence count data (e.g.,VariantFrequencies
vs.InnovationSequenceCounts
), and inference methods have different parameter requirements (e.g.,InferNUTS
vs.InferMAP
). We dynamically parses the configuration, identifies the appropriate components, and instantiates them with the correct arguments while allowing users to override file-based inputs at runtime.Solution
The CLI is implemented within evofr/commands/run_model.py and follows these steps:
Remaining challenges
Usage instructions
For testing purposes, you can run
poetry shell
and then use the commands below.To use a config file, just run:
If you want to override input files at runtime