EpiModel / EpiModel-Gallery

Gallery of Network-Based Epidemic Model Templates for EpiModel
http://epimodel.org
MIT License
52 stars 31 forks source link

"2018-08-ObservedNetworkData" not working with EpiModel 2.1 #32

Closed AdrienLeGuillou closed 3 years ago

AdrienLeGuillou commented 3 years ago

This model fails with error:

A ERROR occured in module 'resim_nets.FUN' at step 2: 
    Error in get_control(dat, "isTERGM"): There is no control value called `isTERGM` in the control list of the Master list object (dat)

simply adding isTERGM = TRUE or isTERGM = FALSE to the control object does not solve the problem. This problem only exists with EpiModel 2.1 and not 2.0.5

AdrienLeGuillou commented 3 years ago

I fixed it by adding

isTERGM = TRUE
save.nwstats = FALSE

to the control object. This happened because of resimulate.network = FALSE. isTERGM and save.nwstats were not setup properly in the custom init function to avoid the issue.

@smjenness, can this happen as well in core EpiModel? I will investigate to see if these two flags should be set automatically when resimulate.network = FALSE

AdrienLeGuillou commented 3 years ago

I just checked, it does not appear to be an issue in core epi-model

smjenness commented 3 years ago

Was this a change you made to the gallery code or to core epimodel?

AdrienLeGuillou commented 3 years ago

To the gallery code, it does not seem to be required in core. I would always make a PR for a core EpiModel change

smjenness commented 3 years ago

Got it, thanks!