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

Multiple output files per command: complete implementation #469

Merged
merged 43 commits into from
Jul 15, 2018
Merged

Conversation

wlandau
Copy link
Member

@wlandau wlandau commented Jul 15, 2018

Summary

After 4 attempts over 5 months, we have an implementation! cc @tiernanmartin, @noamross.

From now on, targets (non-imports) are always R objects. Concomitant output files declared with file_out("file1.csv", "file2.rds") etc. are reproducibly tracked and can serve as input files to downstream targets via file_in(). Example: tests/testthat/test-intermediate-file.R. Changes to file inputs and file outputs cause the corresponding target to rebuild. Changes to file outputs cause changes to downstream targets that accept them as file inputs.

File outputs do not show up in vis_drake_graph()/sankey_drake_graph() and friends because

  1. It would be lot more work, and I did not want to overcomplicate Allow multiple output files for each command #283.
  2. The internal graph is a schedule of imports and targets, with lists of file inputs and file outputs as igraph attributes. I think this is the most expedient solution: no extra data structures, no added heavy data processing.
  3. Graph visuals get cluttered with too many nodes as it is. I think reasonable steps to reduce the number of nodes smoothen the experience (ref: Group together related commands in the graph visualization #229, Group nodes into clusters in graph visualizations #463).

@tiernanmartin, do you have a favorite pedagogical GIS/shapefile workflow? I am considering a new chapter of the manual based on your thoughts from #257.

Related GitHub issues

Checklist

  • I have read drake's code of conduct, and I agree to follow its rules.
  • I have read the guidelines for contributing.
  • I have listed any substantial changes in the development news.
  • I have added testthat unit tests to tests/testthat to confirm that any new features or functionality work correctly.
  • I have tested this pull request locally with devtools::check()
  • This pull request is ready for review.
  • I think this pull request is ready to merge.

wlandau-lilly and others added 30 commits July 13, 2018 09:42
- Stop forcing `file_out()` files to be target names in the workflow plan. There will be one return value per command, which will no longer be a file (once the old file API is removed).
- Allow multiple files in the `file_out()` function itself.
- Explicitly give all target names in `my_plan` from `load_mtcars_example()`.
This ensures file_out()/file_in() connections among targets.
This commit adds a test for this.
Not very elegant. I'm still fighting drake's data structures.
@codecov-io
Copy link

codecov-io commented Jul 15, 2018

Codecov Report

Merging #469 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #469    +/-   ##
======================================
  Coverage     100%   100%            
======================================
  Files          68     67     -1     
  Lines        5685   5566   -119     
======================================
- Hits         5685   5566   -119
Impacted Files Coverage Δ
R/plan.R 100% <ø> (ø)
R/sanitize.R 100% <ø> (ø) ⬆️
R/meta.R 100% <100%> (ø) ⬆️
R/deprecate.R 100% <100%> (ø) ⬆️
R/build.R 100% <100%> (ø) ⬆️
R/clean.R 100% <100%> (ø) ⬆️
R/triggers.R 100% <100%> (ø) ⬆️
R/Makefile.R 100% <100%> (ø) ⬆️
R/mc_utils.R 100% <100%> (ø) ⬆️
R/staged.R 100% <100%> (ø) ⬆️
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 349f7d7...94c9085. Read the comment docs.

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

Successfully merging this pull request may close these issues.

4 participants