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

Utility for clean()ing everything but the contents of a plan #1110

Closed
2 tasks done
kendonB opened this issue Dec 12, 2019 · 1 comment
Closed
2 tasks done

Utility for clean()ing everything but the contents of a plan #1110

kendonB opened this issue Dec 12, 2019 · 1 comment
Assignees

Comments

@kendonB
Copy link
Contributor

kendonB commented Dec 12, 2019

Prework

Proposal

Why dynamic branching, it's now a bit of work to subset the cached() targets to only those not in a plan, given many of the targets in cached() have a hash suffix (i.e. they're expanded) and the plan$target names have the unexpanded target name.

It would be neat to be able to run something like clean(plan_to_exclude = myplan) and the system would only clean those targets that wouldn't get built from myplan.

@wlandau
Copy link
Member

wlandau commented Dec 12, 2019

Good idea. Added cached_unplanned() and cached_planned() in 99a2926.

library(drake)
plan <- drake_plan(w = 1)
make(plan)
#> target w
plan <- drake_plan(
  x = seq_len(2),
  y = target(x, dynamic = map(x))
)
make(plan)
#> target x
#> dynamic y
#> subtarget y_0b3474bd
#> subtarget y_b2a5c9b8
#> aggregate y
cached()
#> [1] "w"          "x"          "y"          "y_0b3474bd" "y_b2a5c9b8"
clean(list = cached_unplanned(plan))
cached()
#> [1] "x"          "y"          "y_0b3474bd" "y_b2a5c9b8"

Created on 2019-12-12 by the reprex package (v0.3.0)

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

No branches or pull requests

2 participants