Skip to content

Commit

Permalink
differences for PR #18
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jul 11, 2023
1 parent 2a98d80 commit 3601ed3
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 44 deletions.
8 changes: 4 additions & 4 deletions basic-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,12 @@ tar_make()

```{.output}
▶ start target penguins_csv_file
● built target penguins_csv_file [0.002 seconds]
● built target penguins_csv_file [0.001 seconds]
▶ start target penguins_data_raw
● built target penguins_data_raw [0.148 seconds]
● built target penguins_data_raw [0.141 seconds]
▶ start target penguins_data
● built target penguins_data [0.011 seconds]
▶ end pipeline [0.244 seconds]
● built target penguins_data [0.009 seconds]
▶ end pipeline [0.231 seconds]
```

Congratulations, you've run your first workflow with `targets`!
Expand Down
32 changes: 16 additions & 16 deletions branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ tar_plan(
✔ skip target penguins_data_raw
✔ skip target penguins_data
▶ start target combined_model
● built target combined_model [0.033 seconds]
▶ end pipeline [0.115 seconds]
● built target combined_model [0.03 seconds]
▶ end pipeline [0.128 seconds]
```

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.
Expand Down Expand Up @@ -147,16 +147,16 @@ tar_plan(
✔ skip target penguins_data
✔ skip target combined_model
▶ start target interaction_model
● built target interaction_model [0.005 seconds]
● built target interaction_model [0.004 seconds]
▶ start target species_model
● built target species_model [0.002 seconds]
● built target species_model [0.001 seconds]
▶ start target combined_summary
● built target combined_summary [0.008 seconds]
● built target combined_summary [0.009 seconds]
▶ start target interaction_summary
● built target interaction_summary [0.045 seconds]
● built target interaction_summary [0.047 seconds]
▶ start target species_summary
● built target species_summary [0.003 seconds]
▶ end pipeline [0.168 seconds]
● built target species_summary [0.005 seconds]
▶ end pipeline [0.17 seconds]
```

Let's look at the summary of one of the models:
Expand Down Expand Up @@ -226,15 +226,15 @@ First, let's look at the messages provided by `tar_make()`.
✔ skip target penguins_data_raw
✔ skip target penguins_data
▶ start target models
● built target models [0.007 seconds]
● built target models [0.006 seconds]
▶ start branch model_summaries_5ad4cec5
● built branch model_summaries_5ad4cec5 [0.009 seconds]
▶ start branch model_summaries_c73912d5
● built branch model_summaries_c73912d5 [0.004 seconds]
● built branch model_summaries_c73912d5 [0.005 seconds]
▶ start branch model_summaries_91696941
● built branch model_summaries_91696941 [0.047 seconds]
● built branch model_summaries_91696941 [0.044 seconds]
● built pattern model_summaries
▶ end pipeline [0.172 seconds]
▶ end pipeline [0.164 seconds]
```

There is a series of smaller targets (branches) that are each named like model_summaries_5ad4cec5, then one overall `model_summaries` target.
Expand Down Expand Up @@ -365,13 +365,13 @@ tar_plan(
✔ skip target penguins_data
✔ skip target models
▶ start branch model_summaries_5ad4cec5
● built branch model_summaries_5ad4cec5 [0.018 seconds]
● built branch model_summaries_5ad4cec5 [0.016 seconds]
▶ start branch model_summaries_c73912d5
● built branch model_summaries_c73912d5 [0.053 seconds]
● built branch model_summaries_c73912d5 [0.055 seconds]
▶ start branch model_summaries_91696941
● built branch model_summaries_91696941 [0.005 seconds]
● built branch model_summaries_91696941 [0.006 seconds]
● built pattern model_summaries
▶ end pipeline [0.18 seconds]
▶ end pipeline [0.184 seconds]
```

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).
Expand Down
18 changes: 9 additions & 9 deletions files.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ tar_plan(

```{.output}
▶ start target some_data
● built target some_data [0.001 seconds]
▶ end pipeline [0.065 seconds]
● built target some_data [0 seconds]
▶ end pipeline [0.061 seconds]
```

If we inspect the contents of `some_data` with `tar_read(some_data)`, it will contain the string `"Hello World"` as expected.
Expand Down Expand Up @@ -101,7 +101,7 @@ tar_plan(
● built target data_file [0.001 seconds]
▶ start target some_data
● built target some_data [0 seconds]
▶ end pipeline [0.072 seconds]
▶ end pipeline [0.065 seconds]
```

This time we see that `targets` does successfully re-build `some_data` as expected.
Expand Down Expand Up @@ -186,10 +186,10 @@ tar_plan(
▶ start target penguins_data_raw_file
● built target penguins_data_raw_file [0.001 seconds]
▶ start target penguins_data_raw
● built target penguins_data_raw [0.27 seconds]
● built target penguins_data_raw [0.272 seconds]
▶ start target penguins_data
● built target penguins_data [0.019 seconds]
▶ end pipeline [0.366 seconds]
▶ end pipeline [0.361 seconds]
```

::::::::::::::::::::::::::::::::::
Expand Down Expand Up @@ -262,12 +262,12 @@ tar_plan(
▶ start target hello_file
● built target hello_file [0.001 seconds]
▶ start target hello
● built target hello [0 seconds]
● built target hello [0.001 seconds]
▶ start target hello_caps
● built target hello_caps [0 seconds]
● built target hello_caps [0.001 seconds]
▶ start target hello_caps_out
● built target hello_caps_out [0.001 seconds]
▶ end pipeline [0.079 seconds]
● built target hello_caps_out [0 seconds]
▶ end pipeline [0.075 seconds]
```

Take a look at `hello_caps.txt` in the `results` folder and verify it is as you expect.
Expand Down
26 changes: 26 additions & 0 deletions hpc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: 'Deploying Targets on HPC'
teaching: 10
exercises: 2
---


sbatch was not detected. Likely Slurm is not installed. Exiting.


















12 changes: 6 additions & 6 deletions lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tar_make()
✔ skip target penguins_csv_file
✔ skip target penguins_data_raw
✔ skip target penguins_data
✔ skip pipeline [0.063 seconds]
✔ skip pipeline [0.067 seconds]
```

Remember how the first time we ran the pipeline, `targets` printed out a list of each target as it was being built?
Expand Down Expand Up @@ -88,8 +88,8 @@ tar_make()
✔ skip target penguins_csv_file
✔ skip target penguins_data_raw
▶ start target penguins_data
● built target penguins_data [0.022 seconds]
▶ end pipeline [0.112 seconds]
● built target penguins_data [0.019 seconds]
▶ end pipeline [0.095 seconds]
```

What happened?
Expand Down Expand Up @@ -259,7 +259,7 @@ tar_make()
✔ skip target penguins_csv_file
✔ skip target penguins_data_raw
✔ skip target penguins_data
✔ skip pipeline [0.056 seconds]
✔ skip pipeline [0.054 seconds]
```

Let's invalidate `penguins_data` and run it again:
Expand All @@ -275,8 +275,8 @@ tar_make()
✔ skip target penguins_csv_file
✔ skip target penguins_data_raw
▶ start target penguins_data
● built target penguins_data [0.02 seconds]
▶ end pipeline [0.101 seconds]
● built target penguins_data [0.027 seconds]
▶ end pipeline [0.108 seconds]
```

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).
Expand Down
7 changes: 4 additions & 3 deletions md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2023-07-11"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2023-07-11"
"config.yaml" "97cf738871f0133f70da7d938c14bfb2" "site/built/config.yaml" "2023-07-11"
"config.yaml" "5b0ca11806a6d604dd96faa2f669590e" "site/built/config.yaml" "2023-07-11"
"index.md" "06bbfd5ab0e2353032361b3321342d13" "site/built/index.md" "2023-07-11"
"links.md" "8184cf4149eafbf03ce8da8ff0778c14" "site/built/links.md" "2023-07-11"
"episodes/introduction.Rmd" "feaacfccab344eb1fa6e702aded97924" "site/built/introduction.md" "2023-07-11"
Expand All @@ -14,8 +14,9 @@
"episodes/branch.Rmd" "b07912f5d8f14eb0e831a6a081ee99f2" "site/built/branch.md" "2023-07-11"
"episodes/parallel.Rmd" "69b941c8fd37a23249e6d16636fb645a" "site/built/parallel.md" "2023-07-11"
"episodes/quarto.Rmd" "a6c2d51f32e4a7e1087b87b211d7a03a" "site/built/quarto.md" "2023-07-11"
"episodes/hpc.Rmd" "6b9f9fdb0d219e45c55e6d61ee01cedd" "site/built/hpc.md" "2023-07-11"
"instructors/instructor-notes.md" "df3784ee5c0436a9e171071f7965d3fc" "site/built/instructor-notes.md" "2023-07-11"
"learners/reference.md" "3f06251c1f932e767ae8f22db25eb5a2" "site/built/reference.md" "2023-07-11"
"learners/setup.md" "99a67bca32058e9f70d6d8e405519826" "site/built/setup.md" "2023-07-11"
"learners/setup.md" "b4bdd601ab985cf048829f49710df7fc" "site/built/setup.md" "2023-07-11"
"profiles/learner-profiles.md" "44d8b9d8aca7963e6577e8c67d23eac0" "site/built/learner-profiles.md" "2023-07-11"
"renv/profiles/lesson-requirements/renv.lock" "e4993bea6dd21f86ad9950337f7ec4f0" "site/built/renv.lock" "2023-07-11"
"renv/profiles/lesson-requirements/renv.lock" "68966b476b940ae0fc805b292f4dc109" "site/built/renv.lock" "2023-07-11"
10 changes: 5 additions & 5 deletions packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ tar_plan(

```{.output}
▶ start target adelie_data
● built target adelie_data [0.028 seconds]
▶ end pipeline [0.093 seconds]
● built target adelie_data [0.024 seconds]
▶ end pipeline [0.085 seconds]
```

This method gets around the slow-downs that may sometimes be experienced with Method 1.
Expand Down Expand Up @@ -100,8 +100,8 @@ tar_plan(

```{.output}
▶ start target adelie_data
● built target adelie_data [0.028 seconds]
▶ end pipeline [0.09 seconds]
● built target adelie_data [0.027 seconds]
▶ end pipeline [0.093 seconds]
```

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.
Expand All @@ -128,7 +128,7 @@ tar_plan(
```{.output}
▶ start target adelie_data
● built target adelie_data [0.014 seconds]
▶ end pipeline [0.078 seconds]
▶ end pipeline [0.079 seconds]
```

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.
Expand Down
2 changes: 1 addition & 1 deletion setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ install.packages(

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).

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

0 comments on commit 3601ed3

Please sign in to comment.