CDCgov / wastewater-informed-covid-forecasting

Wastewater-informed COVID-19 forecasting models submitted to the COVID-19 Forecast Hub
https://cdcgov.github.io/wastewater-informed-covid-forecasting/
Apache License 2.0
43 stars 7 forks source link

Configuration should be data, not code #66

Open kaitejohnson opened 3 months ago

kaitejohnson commented 3 months ago

Problem

At some point soon we should either move away from scripts to generate config files and just edit the config files themselves (my preference) or conversely move to scripts as config files, i.e. you source(config.R) (not my preference).

Originally posted by @dylanhmorris in https://github.com/cdcent/cfa-forecast-renewal-ww/pull/400#pullrequestreview-1871121437

Context

Plain file configuration (my preference)

For an example of my preferred workflow, the epidemia repo. I just manually edit this .toml file to configure the weekly run https://github.com/cdcent/cfa-forecast-renewal-epidemia/blob/main/data/params.toml

Script as config file (not my preference)

For an example of "script as config file", here's an old approach of mine using an .R script to define the values of prior hyperparameters for a Stan model: https://github.com/dylanhmorris/n95-decontamination/blob/master/src/parameters/decon_hyperparams.R

When then got source-d when fitting the model:

https://github.com/dylanhmorris/n95-decontamination/blob/bc0be59d5c67b227a24f5226881b394b5b8dcc29/src/fit_stan_model.R#L47-L49

Again: this is not how I'd do things now.