Closed multimeric closed 1 year ago
Thank you for your pull request :smiley:
:robot: This automated message can help you check the rendered files in your submission for clarity. If you have any questions, please feel free to open an issue in {sandpaper}.
If you have files that automatically render output (e.g. R Markdown), then you should check for the following:
:mag: Inspect the changes: https://github.com/carpentries-incubator/targets-workshop/compare/md-outputs..md-outputs-PR-19
The following changes were observed in the rendered markdown documents:
basic-targets.md | 9 +-
branch.md | 91 +-
cache.md | 2 -
config.yaml (gone) | 87 -
files.md | 22 +-
files/lesson_functions.R (new) | 59 +
files/packages.R (new) | 5 +
files/plans/README.md (new) | 1 +
files/plans/plan_1.R (new) | 21 +
files/plans/plan_10.R (new) | 42 +
files/plans/plan_11.R (new) | 42 +
files/plans/plan_2.R (new) | 10 +
files/plans/plan_2b.R (new) | 9 +
files/plans/plan_3.R (new) | 12 +
files/plans/plan_4.R (new) | 19 +
files/plans/plan_5.R (new) | 31 +
files/plans/plan_6.R (new) | 29 +
files/plans/plan_7.R (new) | 29 +
files/plans/plan_8.R (new) | 35 +
files/plans/plan_9.R (new) | 42 +
files/tar_functions/README.md (new) | 3 +
files/tar_functions/augment_with_mod_name.R (new) | 6 +
.../augment_with_mod_name_slow.R (new) | 7 +
files/tar_functions/clean_penguin_data.R (new) | 11 +
files/tar_functions/glance_with_mod_name.R (new) | 6 +
.../glance_with_mod_name_slow.R (new) | 7 +
files/tar_functions/write_lines_file.R (new) | 4 +
lifecycle.md | 30 +-
md5sum.txt | 40 +-
organization.md | 10 +-
packages.md | 12 +-
parallel.md | 37 +-
quarto.md | 2 +-
renv.lock (gone) | 1793 --------------------
setup.md | 2 +-
35 files changed, 566 insertions(+), 2001 deletions(-)
:stopwatch: Updated at 2023-08-01 10:05:36 +0000
@multimeric Thanks, I really like how this cleans up the code. I took it one step further and used this approach for almost all the penguin examples - I think it makes more sense once you get in the mental state of looking at the plan_*.R files.
(BTW the rubber ducky "carpentries-bot" is me... for some odd reason sandpaper repos have a habit of doing that!)
If this looks good to you, I'm happy to merge.
Great! The shame is that if you preferred the files method to the chunk writing method, #17 may have been better to work off. Ah well, at least you've been able to see both approaches this way.
If you don't like the chunk saving approach, I can remove it from the codebase to simplify things?
I still use it in some places, e.g. write_example_plan(chunk = "example-file-show-1")
in files.Rmd
(if that's what you're talking about), so I think we should leave it.
Okay, I'm fine with whichever combination of approaches you're happy to work with. Either way removes the redundancy and makes development easier so I'm happy :+1:
I realized the external plan file works well for the penguins examples, because they get run repeatedly and gradually build up in complexity. But the chunk approach is nice for short "one-off" examples where it's easier to grok with the plan right there in the Rmd. So thanks for making both available!
Cool, I'm happy to merge then
_targets.R
wherever possible, which simplifies the codebase, for example: https://github.com/carpentries-incubator/targets-workshop/blob/7aa418cdc0da6ac6e17482acbd8f70a0f3bfe48a/episodes/branch.Rmd#L166-L167files/plans
, with one plan per file.clean_penguin_data
have moved intofiles/tar_functions
file:
chunk such as: https://github.com/carpentries-incubator/targets-workshop/blob/7aa418cdc0da6ac6e17482acbd8f70a0f3bfe48a/episodes/branch.Rmd#L317readLines(file)[lines]
: https://github.com/carpentries-incubator/targets-workshop/blob/7aa418cdc0da6ac6e17482acbd8f70a0f3bfe48a/episodes/branch.Rmd#L261pushd
andpopd
utility functions that let us reduce the number of hidden chunks significantly, because we can instead just hide the utility functions: https://github.com/carpentries-incubator/targets-workshop/blob/7aa418cdc0da6ac6e17482acbd8f70a0f3bfe48a/episodes/branch.Rmd#L343-L351