Add a simple CLI for use in unified model interface #689
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.
Related issues and PRs
Description
This PR adds a simple CLI entry point that:
ScenarioData
) from a specified input pathrun.ts
AlgorithmResult
) into the specified output pathThis allows the model to be run in a unified model UI, such as the one we are maintaining at https://github.com/covid-modeling on the GitHub side. We are already using a version of this at https://github.com/covid-modeling/model-runner to run this model, but are currently tied to my fork that has the CLI entry point and an older version of your model. Having this code as part of the model repo enables the unified interface to keep up with model changes, and so better represent the latest state of your model.
@ivan-aksamentov @nnoll I would be grateful for a review, and hope this will minimally impact your existing work. Let me know if you have questions.
Impacted Areas in the application
No changes to existing code, introduces new entry point that calls
run
.Testing
yarn schema:clean && yarn schema:totypes
.ScenarioData
in a file, sayinput-file.json
. One of the existing objects inscenarios.json
will work.path/to/output-file.json
, which is assumed to not already exist.