From 719c23b1a47a37544de08179016b4f6671e1f011 Mon Sep 17 00:00:00 2001 From: "Carl A. B. Pearson" Date: Wed, 11 Dec 2024 13:47:20 -0500 Subject: [PATCH] update multi-configs gitbook --- .../gitbook/how-to-run/multi-configs.md | 37 ++----------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/documentation/gitbook/how-to-run/multi-configs.md b/documentation/gitbook/how-to-run/multi-configs.md index 738de3399..27e65b324 100644 --- a/documentation/gitbook/how-to-run/multi-configs.md +++ b/documentation/gitbook/how-to-run/multi-configs.md @@ -32,46 +32,17 @@ you'll get a basic foward simulation of this example model. However, you might a flepimop simulate config_sample_2pop.yml config_sample_2pop_outcomes_part.yml ``` -if want to see what the combined configuration is, you can use the `patch` command: +if want to create a combined configuration (e.g. to check what the combined configuration is), you can use the `patch` command: ```bash -flepimop patch config_sample_2pop.yml config_sample_2pop_outcomes_part.yml +flepimop patch config_sample_2pop.yml config_sample_2pop_outcomes_part.yml > config_new.yml +cat config_new.yml ``` You may provide an arbitrary number of separate configuration files to combine to create a complete configuration. ## Caveats -At this time, only `simulate` supports multiple configuration files. Also, the patching operation is fairly crude: configuration options override previous ones completely, though with a warning. The files provided from left to right are from lowest priority (i.e. for the first file, only options specified in no other files are used) to highest priority (i.e. for the last file, its options override any other specification). +At this time, only `simulate` supports multiple configuration files. Also, the patching operation is fairly crude: if multiple configuration files specify the same option, this will yield an error. We are expanding coverage of this capability to other flepimop actions, e.g. inference, and are exploring options for smarter patching. - -However, currently there are pitfalls like - -```yaml -# config1 -seir_modifiers: - scenarios: ["one", "two"] - one: - # ... - two: - # ... -``` - -```yaml -# config2 -seir_modifiers: - scenarios: ["one", "three"] - one: - # ... - three: - # ... -``` - -Then you might expect - -```bash -flepimop simulate config1.yml config2.yml -``` - -...to override seir scenario one and add scenario three, but what actually happens is that the entire seir_modifiers from config1 is overriden by config2. Specifying the configuration files in the reverse order would lead to a different outcome (the config1 seir_modifiers overrides config2 settings). If you're doing complex combinations of configuration files, you should use `flepimop patch ...` to ensure you're getting what you expect. \ No newline at end of file