metrumresearchgroup / bbr

R interface for model and project management
https://metrumresearchgroup.github.io/bbr/
Other
23 stars 2 forks source link

bbi_args parallel=FALSE with no threads passed fails #553

Closed seth127 closed 1 year ago

seth127 commented 1 year ago

Summary

bbi 1.4.0 (specifically #514) made the change that users no longer have to specify parallel = TRUE to have submit_model() respect the number passed the threads.

Unfortunately, it also introduced a bug where passing parallel = FALSE without passing threads causes an error.

Example

You can reproduce this with the test suite model like so. Note that you have to pass threads = NULL to reproduce with the test model because it already has threads = 4 attached to the model object.

MOD1 %>% submit_model(.bbi_args = list(parallel = F, threads = NULL))
# Error in if (.args$threads > 1 && isFALSE(.args$parallel)) warning("`threads > 1` but model will not run in parallel because `parallel = FALSE`") : 
#  missing value where TRUE/FALSE needed 

Desired state

The user should be able to pass submit_model(..., .bbi_args = list(parallel = FALSE)) to disable parallelization for that run.