Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelisation only happens when future is attached than loaded #363

Open
FinYang opened this issue Jun 27, 2022 · 0 comments
Open

Parallelisation only happens when future is attached than loaded #363

FinYang opened this issue Jun 27, 2022 · 0 comments

Comments

@FinYang
Copy link

FinYang commented Jun 27, 2022

if(is_attached("package:future")){

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.

fabletools/R/model.R

Lines 27 to 30 in 9794d22

#' It is possible to estimate models in parallel using the
#' [future](https://cran.r-project.org/package=future) package. By specifying a
#' [`future::plan()`] before estimating the models, they will be computed
#' according to that plan.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant