fabletools icon indicating copy to clipboard operation
fabletools copied to clipboard

Parallelisation only happens when `future` is attached than loaded

Open FinYang opened this issue 2 years ago • 0 comments

https://github.com/tidyverts/fabletools/blob/9794d225a37e79aaab18655692eca54bb3e1aed7/R/model.R#L100

future::plan(future::multisession)
rlang::is_attached("package:future")
#> [1] FALSE
library(future)
rlang::is_attached("package:future")
#> [1] TRUE

Created on 2022-06-27 by the reprex package (v2.0.1)

Is this an intended behaviour? It took me some time to figure out why future::plan(future::multisession) does not work since the documentation does not require future to be attached. I thought it was something wrong with my future.

https://github.com/tidyverts/fabletools/blob/9794d225a37e79aaab18655692eca54bb3e1aed7/R/model.R#L27-L30

Wouldn't it be better to check if the future::plan is future::sequential when future is loaded rather than to check if it is attached? It would be nice to have the option to run it in parallel without ever putting future onto the search path.

FinYang avatar Jun 27 '22 01:06 FinYang