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

Automatically handle dynamic dependencies of static targets #1107

Closed
2 tasks done
wlandau opened this issue Dec 10, 2019 · 2 comments
Closed
2 tasks done

Automatically handle dynamic dependencies of static targets #1107

wlandau opened this issue Dec 10, 2019 · 2 comments

Comments

@wlandau
Copy link
Member

wlandau commented Dec 10, 2019

Prework

Description

At #685, #1064, #1090, and #1103, I said that downstream targets of dynamic targets must be dynamic except if you use readd() to turn a dynamic target into a static one. This was always problematic because it required the user to understand the internals of dynamic branching. I just had an idea about how to avoid this problem. It has to do with the internals of memory management, and if it works, we will be able to write plans like this:

drake_plan(
   raw = mtcars[seq_len(4), ],
   rows = target(raw[, c("mpg", "cyl")], dynamic = map(raw)),
   means = colMeans(rows) # no readd()
)

Currently it fails because drake thinks rows is a vector of hashes (i.e. how it represents dynamic targets). The goal for this example is to get drake to understand that rows should be a data frame for means.

cc @dpmccabe, @keondonB, @billdenney, @brendanf

@wlandau wlandau self-assigned this Dec 10, 2019
@wlandau wlandau changed the title Automatically handle downstream targets of dynamic targets Automatically handle dynamic dependencies of static targets Dec 10, 2019
@brendanf
Copy link
Contributor

Is there still an exported function to get the vector of keys to the subtargets? Here I'm thinking of my combine_dynamic_diskframe in #1076 (comment).

@wlandau
Copy link
Member Author

wlandau commented Dec 11, 2019

Yes, the subtargets() function does this and is still available.

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