-
Notifications
You must be signed in to change notification settings - Fork 86
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
do.call and future::plan #639
Comments
Thanks for reporting on this. It's been fixed for the next release. Until then, one can use either of: do.call(what = future::plan, args = list(strategy = "future::multisession", workers = 2))
do.call(what = future::plan, args = list(strategy = quote(future::multisession), workers = 2)) |
… 'workers' argument, and any other arguments [#639]
Thanks for the tips. I just add it and I can confirm that it solved the issue with worker. do.call(what = future::plan, args = list(strategy = quote(future::multisession), workers = 2, lazy = TRUE))
# Error: Detected arguments that must not be set via plan() or tweak(): ‘lazy’ PS: if it can help, in my use case I got error with: ‘envir’, ‘packages’, ‘seed’, ‘lazy’, ‘globals’ This happens with former version of {future} using the quote trick and also the current one just installed with remotes::install_github("HenrikBengtsson/future") |
That's intentional by design, e.g. > plan(multisession, workers = 2, lazy = TRUE)
Error: Detected arguments that must not be set via plan() or tweak(): 'lazy' None of those arguments must be used by |
I should say that you are right and what I am trying to achieve is close to what is described in futureverse/progressr#78 However, the documentation of future::plan says that Therefore, as # the folowing works:
future::multisession(workers = 2, lazy = TRUE, envir = new.env())
# but despite the doc, the folowing produces an error
do.call(what = future::plan, args = list(strategy = future::multisession, workers = 2, lazy = TRUE, envir = new.env())) By extension, the documentation of future::multisession says that As a consequence, while doable with |
It seems calling future::plan inside do.call does not allow to pass extra parameters to
strategy
through...
Here is a minimal reprex considering that you have at least more than 2 cores
sessionInfo()
The text was updated successfully, but these errors were encountered: