Skip to content

Commit

Permalink
update multi-configs gitbook to give caveat example
Browse files Browse the repository at this point in the history
  • Loading branch information
pearsonca committed Oct 29, 2024
1 parent cb91676 commit 00591eb
Showing 1 changed file with 34 additions and 2 deletions.
36 changes: 34 additions & 2 deletions documentation/gitbook/how-to-run/multi-configs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
description: >-
How to use multiple configuration files.
Patching together multiple configuration files.
---

# Using Multiple Configuration Files
Expand Down Expand Up @@ -40,6 +40,38 @@ flepimop patch config_sample_2pop.yml config_sample_2pop_outcomes_part.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).

We are expanding coverage of this capability to other flepimop actions, e.g. inference, and are exploring options for smarter patching.
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.

0 comments on commit 00591eb

Please sign in to comment.