-
Notifications
You must be signed in to change notification settings - Fork 129
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
make(session = callr::r_vanilla) #346
Conversation
...which is fine because I restore it afterwards.
Codecov Report
@@ Coverage Diff @@
## master #346 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 66 66
Lines 5246 5266 +20
=====================================
+ Hits 5246 5266 +20
Continue to review full report at Codecov.
|
Mo objections - it looks fine, although I don't have any time to test it. Will do that beginning of next week. |
Thinking about it - would it be necessary to also use the Must admit, havern't looked at the code yet... |
Unfortunately, we really do need the original session to build the graph. That way, we know which global imports we need to transfer to the new session. The alternative is just to copy over everything from library(drake)
#> Warning: replacing previous import 'graph::addNode' by 'XML::addNode' when
#> loading 'CodeDepends'
#> Warning: replacing previous import 'graph::plot' by 'graphics::plot' when
#> loading 'CodeDepends'
clean(destroy = TRUE)
envir <- new.env(parent = baseenv())
evalq({
f <- function(x) {
g(x) + 1
}
g <- function(x) {
x + 1
}
}, envir = envir)
plan <- drake_plan(y = f(1))
make(plan, envir = envir, session = callr::r_vanilla)
readd(y)
#> [1] 3 |
But this only impacts on the graph, or also the functioning of the compilation of the targets - right? So this is not a serious limitation for the repoducability of the targets / make process, but only for the dependency graph? |
Sorry, I am not sure what you mean. |
Summary
Adds a
session
argument tomake()
anddrake_config()
to optionally tellmake_with_config()
to operate in a new, fresh, isolated master session. Example withreprex
:Benefits:
Drawbacks:
libpath
to.libPaths()
, so reproducibility is not perfect.make()
, but this is still bad form.cc @rkrug, @AlexAxthelm, @krlmlr.
GitHub issues fixed
Checklist
drake
's code of conduct, and I agree to follow its rules.testthat
unit tests totests/testthat
to confirm that any new features or functionality work correctly.devtools::check()