Open kaitejohnson opened 3 months ago
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).
source(config.R)
Originally posted by @dylanhmorris in https://github.com/cdcent/cfa-forecast-renewal-ww/pull/400#pullrequestreview-1871121437
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
.toml
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
.R
When then got source-d when fitting the model:
source
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.
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.tomlScript 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.RWhen 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.