Skip to content

Commit 299cb2d

Browse files
committed
differences for PR #18
1 parent 2786e69 commit 299cb2d

File tree

8 files changed

+87
-60
lines changed

8 files changed

+87
-60
lines changed

basic-targets.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,12 @@ tar_make()
278278

279279
```{.output}
280280
▶ start target penguins_csv_file
281-
● built target penguins_csv_file [0.002 seconds]
281+
● built target penguins_csv_file [0.001 seconds]
282282
▶ start target penguins_data_raw
283-
● built target penguins_data_raw [0.148 seconds]
283+
● built target penguins_data_raw [0.161 seconds]
284284
▶ start target penguins_data
285-
● built target penguins_data [0.011 seconds]
286-
▶ end pipeline [0.244 seconds]
285+
● built target penguins_data [0.012 seconds]
286+
▶ end pipeline [0.269 seconds]
287287
```
288288

289289
Congratulations, you've run your first workflow with `targets`!

branch.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ tar_plan(
7979
✔ skip target penguins_data_raw
8080
✔ skip target penguins_data
8181
▶ start target combined_model
82-
● built target combined_model [0.033 seconds]
83-
▶ end pipeline [0.115 seconds]
82+
● built target combined_model [0.056 seconds]
83+
▶ end pipeline [0.153 seconds]
8484
```
8585

8686
Let's have a look at the model. We will use the `glance()` function from the `broom` package. Unlike base R `summary()`, this function returns output as a tibble (the tidyverse equivalent of a dataframe), which as we will see later is quite useful for downstream analyses.
@@ -151,12 +151,12 @@ tar_plan(
151151
▶ start target species_model
152152
● built target species_model [0.002 seconds]
153153
▶ start target combined_summary
154-
● built target combined_summary [0.008 seconds]
154+
● built target combined_summary [0.009 seconds]
155155
▶ start target interaction_summary
156-
● built target interaction_summary [0.045 seconds]
156+
● built target interaction_summary [0.052 seconds]
157157
▶ start target species_summary
158-
● built target species_summary [0.003 seconds]
159-
▶ end pipeline [0.168 seconds]
158+
● built target species_summary [0.004 seconds]
159+
▶ end pipeline [0.191 seconds]
160160
```
161161

162162
Let's look at the summary of one of the models:
@@ -226,15 +226,15 @@ First, let's look at the messages provided by `tar_make()`.
226226
✔ skip target penguins_data_raw
227227
✔ skip target penguins_data
228228
▶ start target models
229-
● built target models [0.007 seconds]
229+
● built target models [0.008 seconds]
230230
▶ start branch model_summaries_5ad4cec5
231-
● built branch model_summaries_5ad4cec5 [0.009 seconds]
231+
● built branch model_summaries_5ad4cec5 [0.01 seconds]
232232
▶ start branch model_summaries_c73912d5
233233
● built branch model_summaries_c73912d5 [0.004 seconds]
234234
▶ start branch model_summaries_91696941
235-
● built branch model_summaries_91696941 [0.047 seconds]
235+
● built branch model_summaries_91696941 [0.055 seconds]
236236
● built pattern model_summaries
237-
▶ end pipeline [0.172 seconds]
237+
▶ end pipeline [0.2 seconds]
238238
```
239239

240240
There is a series of smaller targets (branches) that are each named like model_summaries_5ad4cec5, then one overall `model_summaries` target.
@@ -365,13 +365,13 @@ tar_plan(
365365
✔ skip target penguins_data
366366
✔ skip target models
367367
▶ start branch model_summaries_5ad4cec5
368-
● built branch model_summaries_5ad4cec5 [0.018 seconds]
368+
● built branch model_summaries_5ad4cec5 [0.022 seconds]
369369
▶ start branch model_summaries_c73912d5
370-
● built branch model_summaries_c73912d5 [0.053 seconds]
370+
● built branch model_summaries_c73912d5 [0.066 seconds]
371371
▶ start branch model_summaries_91696941
372-
● built branch model_summaries_91696941 [0.005 seconds]
372+
● built branch model_summaries_91696941 [0.006 seconds]
373373
● built pattern model_summaries
374-
▶ end pipeline [0.18 seconds]
374+
▶ end pipeline [0.219 seconds]
375375
```
376376

377377
And this time, when we load the `model_summaries`, we can tell which model corresponds to which row (you may need to scroll to the right to see it).

files.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ tar_plan(
5656

5757
```{.output}
5858
▶ start target some_data
59-
● built target some_data [0.001 seconds]
60-
▶ end pipeline [0.065 seconds]
59+
● built target some_data [0 seconds]
60+
▶ end pipeline [0.071 seconds]
6161
```
6262

6363
If we inspect the contents of `some_data` with `tar_read(some_data)`, it will contain the string `"Hello World"` as expected.
@@ -77,7 +77,7 @@ tar_plan(
7777

7878
```{.output}
7979
✔ skip target some_data
80-
✔ skip pipeline [0.047 seconds]
80+
✔ skip pipeline [0.052 seconds]
8181
```
8282

8383
The target `some_data` was skipped, even though the contents of the file changed.
@@ -100,8 +100,8 @@ tar_plan(
100100
▶ start target data_file
101101
● built target data_file [0.001 seconds]
102102
▶ start target some_data
103-
● built target some_data [0 seconds]
104-
▶ end pipeline [0.072 seconds]
103+
● built target some_data [0.001 seconds]
104+
▶ end pipeline [0.08 seconds]
105105
```
106106

107107
This time we see that `targets` does successfully re-build `some_data` as expected.
@@ -186,10 +186,10 @@ tar_plan(
186186
▶ start target penguins_data_raw_file
187187
● built target penguins_data_raw_file [0.001 seconds]
188188
▶ start target penguins_data_raw
189-
● built target penguins_data_raw [0.27 seconds]
189+
● built target penguins_data_raw [0.32 seconds]
190190
▶ start target penguins_data
191-
● built target penguins_data [0.019 seconds]
192-
▶ end pipeline [0.366 seconds]
191+
● built target penguins_data [0.023 seconds]
192+
▶ end pipeline [0.427 seconds]
193193
```
194194

195195
::::::::::::::::::::::::::::::::::
@@ -260,14 +260,14 @@ tar_plan(
260260

261261
```{.output}
262262
▶ start target hello_file
263-
● built target hello_file [0.001 seconds]
263+
● built target hello_file [0 seconds]
264264
▶ start target hello
265-
● built target hello [0 seconds]
265+
● built target hello [0.001 seconds]
266266
▶ start target hello_caps
267267
● built target hello_caps [0 seconds]
268268
▶ start target hello_caps_out
269269
● built target hello_caps_out [0.001 seconds]
270-
▶ end pipeline [0.079 seconds]
270+
▶ end pipeline [0.09 seconds]
271271
```
272272

273273
Take a look at `hello_caps.txt` in the `results` folder and verify it is as you expect.

hpc.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: 'Deploying Targets on HPC'
3+
teaching: 10
4+
exercises: 2
5+
---
6+
7+
8+
sbatch was not detected. Likely Slurm is not installed. Exiting.
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+

lifecycle.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ tar_make()
4343
✔ skip target penguins_csv_file
4444
✔ skip target penguins_data_raw
4545
✔ skip target penguins_data
46-
✔ skip pipeline [0.063 seconds]
46+
✔ skip pipeline [0.069 seconds]
4747
```
4848

4949
Remember how the first time we ran the pipeline, `targets` printed out a list of each target as it was being built?
@@ -89,7 +89,7 @@ tar_make()
8989
✔ skip target penguins_data_raw
9090
▶ start target penguins_data
9191
● built target penguins_data [0.022 seconds]
92-
▶ end pipeline [0.112 seconds]
92+
▶ end pipeline [0.109 seconds]
9393
```
9494

9595
What happened?
@@ -259,7 +259,7 @@ tar_make()
259259
✔ skip target penguins_csv_file
260260
✔ skip target penguins_data_raw
261261
✔ skip target penguins_data
262-
✔ skip pipeline [0.056 seconds]
262+
✔ skip pipeline [0.069 seconds]
263263
```
264264

265265
Let's invalidate `penguins_data` and run it again:
@@ -275,8 +275,8 @@ tar_make()
275275
✔ skip target penguins_csv_file
276276
✔ skip target penguins_data_raw
277277
▶ start target penguins_data
278-
● built target penguins_data [0.02 seconds]
279-
▶ end pipeline [0.101 seconds]
278+
● built target penguins_data [0.023 seconds]
279+
▶ end pipeline [0.112 seconds]
280280
```
281281

282282
If you want to reset **everything** and start fresh, you can use `tar_invalidate(everything())` (`tar_invalidate()` [accepts `tidyselect` expressions](https://docs.ropensci.org/targets/reference/tar_invalidate.html) to specify target names).

md5sum.txt

+21-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
"file" "checksum" "built" "date"
2-
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2023-07-11"
3-
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2023-07-11"
4-
"config.yaml" "97cf738871f0133f70da7d938c14bfb2" "site/built/config.yaml" "2023-07-11"
5-
"index.md" "06bbfd5ab0e2353032361b3321342d13" "site/built/index.md" "2023-07-11"
6-
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2023-07-11"
7-
"episodes/introduction.Rmd" "feaacfccab344eb1fa6e702aded97924" "site/built/introduction.md" "2023-07-11"
8-
"episodes/basic-targets.Rmd" "9a431b9a3596cb55c1f62f905cb808a2" "site/built/basic-targets.md" "2023-07-11"
9-
"episodes/cache.Rmd" "6395b6d5b81a029daf9d37a2cb56d6d9" "site/built/cache.md" "2023-07-11"
10-
"episodes/lifecycle.Rmd" "b52fcffdd75504e8579c8a7f1908ade2" "site/built/lifecycle.md" "2023-07-11"
11-
"episodes/organization.Rmd" "ef33426eed3d4e0784a728b5aa670836" "site/built/organization.md" "2023-07-11"
12-
"episodes/packages.Rmd" "2812a10b7ae0e8e0b3e000a5b74f939c" "site/built/packages.md" "2023-07-11"
13-
"episodes/files.Rmd" "f05ed479ce1a0dfdcc14ebcd872c554c" "site/built/files.md" "2023-07-11"
14-
"episodes/branch.Rmd" "b07912f5d8f14eb0e831a6a081ee99f2" "site/built/branch.md" "2023-07-11"
15-
"episodes/parallel.Rmd" "69b941c8fd37a23249e6d16636fb645a" "site/built/parallel.md" "2023-07-11"
16-
"episodes/quarto.Rmd" "a6c2d51f32e4a7e1087b87b211d7a03a" "site/built/quarto.md" "2023-07-11"
17-
"instructors/instructor-notes.md" "df3784ee5c0436a9e171071f7965d3fc" "site/built/instructor-notes.md" "2023-07-11"
18-
"learners/reference.md" "3f06251c1f932e767ae8f22db25eb5a2" "site/built/reference.md" "2023-07-11"
19-
"learners/setup.md" "99a67bca32058e9f70d6d8e405519826" "site/built/setup.md" "2023-07-11"
20-
"profiles/learner-profiles.md" "44d8b9d8aca7963e6577e8c67d23eac0" "site/built/learner-profiles.md" "2023-07-11"
21-
"renv/profiles/lesson-requirements/renv.lock" "e4993bea6dd21f86ad9950337f7ec4f0" "site/built/renv.lock" "2023-07-11"
2+
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2023-07-12"
3+
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2023-07-12"
4+
"config.yaml" "5b0ca11806a6d604dd96faa2f669590e" "site/built/config.yaml" "2023-07-12"
5+
"index.md" "06bbfd5ab0e2353032361b3321342d13" "site/built/index.md" "2023-07-12"
6+
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2023-07-12"
7+
"episodes/introduction.Rmd" "feaacfccab344eb1fa6e702aded97924" "site/built/introduction.md" "2023-07-12"
8+
"episodes/basic-targets.Rmd" "9a431b9a3596cb55c1f62f905cb808a2" "site/built/basic-targets.md" "2023-07-12"
9+
"episodes/cache.Rmd" "6395b6d5b81a029daf9d37a2cb56d6d9" "site/built/cache.md" "2023-07-12"
10+
"episodes/lifecycle.Rmd" "b52fcffdd75504e8579c8a7f1908ade2" "site/built/lifecycle.md" "2023-07-12"
11+
"episodes/organization.Rmd" "ef33426eed3d4e0784a728b5aa670836" "site/built/organization.md" "2023-07-12"
12+
"episodes/packages.Rmd" "2812a10b7ae0e8e0b3e000a5b74f939c" "site/built/packages.md" "2023-07-12"
13+
"episodes/files.Rmd" "f05ed479ce1a0dfdcc14ebcd872c554c" "site/built/files.md" "2023-07-12"
14+
"episodes/branch.Rmd" "b07912f5d8f14eb0e831a6a081ee99f2" "site/built/branch.md" "2023-07-12"
15+
"episodes/parallel.Rmd" "69b941c8fd37a23249e6d16636fb645a" "site/built/parallel.md" "2023-07-12"
16+
"episodes/quarto.Rmd" "a6c2d51f32e4a7e1087b87b211d7a03a" "site/built/quarto.md" "2023-07-12"
17+
"episodes/hpc.Rmd" "e4dc6ad85746a4b8a147e41ac18ca281" "site/built/hpc.md" "2023-07-12"
18+
"instructors/instructor-notes.md" "df3784ee5c0436a9e171071f7965d3fc" "site/built/instructor-notes.md" "2023-07-12"
19+
"learners/reference.md" "3f06251c1f932e767ae8f22db25eb5a2" "site/built/reference.md" "2023-07-12"
20+
"learners/setup.md" "b4bdd601ab985cf048829f49710df7fc" "site/built/setup.md" "2023-07-12"
21+
"profiles/learner-profiles.md" "44d8b9d8aca7963e6577e8c67d23eac0" "site/built/learner-profiles.md" "2023-07-12"
22+
"renv/profiles/lesson-requirements/renv.lock" "0ef31347a5f441da417df76687c654a2" "site/built/renv.lock" "2023-07-12"

packages.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ tar_plan(
7171

7272
```{.output}
7373
▶ start target adelie_data
74-
● built target adelie_data [0.028 seconds]
75-
▶ end pipeline [0.093 seconds]
74+
● built target adelie_data [0.029 seconds]
75+
▶ end pipeline [0.1 seconds]
7676
```
7777

7878
This method gets around the slow-downs that may sometimes be experienced with Method 1.
@@ -101,7 +101,7 @@ tar_plan(
101101
```{.output}
102102
▶ start target adelie_data
103103
● built target adelie_data [0.028 seconds]
104-
▶ end pipeline [0.09 seconds]
104+
▶ end pipeline [0.098 seconds]
105105
```
106106

107107
This can be more memory efficient in some cases than loading all packages, since not every target is always made during a typical run of the workflow.
@@ -127,8 +127,8 @@ tar_plan(
127127

128128
```{.output}
129129
▶ start target adelie_data
130-
● built target adelie_data [0.014 seconds]
131-
▶ end pipeline [0.078 seconds]
130+
● built target adelie_data [0.015 seconds]
131+
▶ end pipeline [0.087 seconds]
132132
```
133133

134134
The benefits of this approach are that the origins of all functions is explicit, so you could browse your code (for example, by looking at its source in GitHub), and immediately know where all the functions come from.

setup.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ install.packages(
3131

3232
There is a [Posit Cloud](https://posit.cloud/) instance with RStudio and all necessary packages pre-installed available, so you don't need to install anything on your own computer. You may need to create an account (free).
3333

34-
Click this link to open: <https://posit.cloud/content/6064275>
34+
Click this link to open: <https://posit.cloud/content/6064275>

0 commit comments

Comments
 (0)