HopkinsIDD / flepiMoP

The Flexible Epidemic Modeling Pipeline
https://flepimop.org
GNU General Public License v3.0
7 stars 3 forks source link

sunset calls to create_seeding.R within inference #213

Open alsnhll opened 2 months ago

alsnhll commented 2 months ago

Currently in inference:initialize_mcmc_first_block, if the seeding file does not already exist in the model output directory AND if the file specified in seeding:lambda_file in the config does not exist, it will call create_seeding.R to create it. But this is a hidden option, not documented anywhere. We want it to be specified directly in the config if external scripts are going to be run to create required files.

if(!file.exists(config$seeding$lambda_file)) { print("Will create seeding lambda file using flepimop/main_scripts/create_seeding.R") #Need to document this

In the same function, there is also a hidden option for adding new seedings if it is a resume run:

additional seeding for new variants or introductions to add to fitted seeding (for resumes)

    #   need to document!!
    if (!is.null(config$seeding$added_seeding) & is_resume & block <= 1){
        if(!file.exists(config$seeding$added_seeding$added_lambda_file)) {
            err <- system(paste(
                opt$rpath,
                paste(opt$flepi_path, "flepimop", "main_scripts", "create_seeding_added.R", sep = "/"),
                "-c", opt$config
            ))
            if (err != 0) {
                stop("Could not run added seeding")
            }
        }
saraloo commented 4 weeks ago

This should be fixed with the plugin option. We need to addresshow the classical inference scripts should handle these plugins.

Currently gempyor handles these, which causes issues in inference_slot if files do not exist yet (eg if a plugin creates seeding files, they do not yet exist if gempyor hasn't been called yet but sometimes inference_slot looks for these).

Another action item is to move these scripts to the COVID19_USA repo.