You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-30Lines changed: 19 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Exploration Tooling
2
2
3
-
This repo is meant to be a place to explore different forecasting methods and tools for both COVID and flu.
3
+
This repo is for exploring forecasting methods and tools for both COVID and Flu.
4
4
The repo is structured as a [targets](https://docs.ropensci.org/targets/) project, which means that it is easy to run things in parallel and to cache results.
5
5
The repo is also structured as an R package, which means that it is easy to share code between different targets.
6
6
@@ -12,7 +12,6 @@ Define run parameters:
12
12
# Save to your `.Renviron` file:
13
13
EPIDATR_USE_CACHE=true
14
14
# not strictly necessary, but you probably want a long cache time, since this is for the historical data
-`EPIDATR_USE_CACHE` controls whether `epidatr` functions use the cache.
25
-
-`DEBUG_MODE` controls whether `targets::tar_make` is run with the `callr_function=NULL`, which allows for debugging. This only works if parallelization has been turned off in `scripts/targets-common.R` by setting the default controller to serial on line 51.
26
-
-`USE_SHINY` controls whether we start a Shiny server after producing the targets.
27
-
-`TAR_PROJECT` controls which `targets` project is run by `run.R`. Likely either `covid_hosp_explore` or `flu_hosp_explore`
28
-
-`EXTERNAL_SCORES_PATH` controls where external scores are loaded from. If not set, external scores are not used.
29
-
-`AWS_S3_PREFIX` controls the prefix to use in the AWS S3 bucket (a prefix is a pseudo-directory in a bucket).
23
+
-`EPIDATR_USE_CACHE` controls whether `epidatr` functions use the cache.
24
+
-`DEBUG_MODE` controls whether `targets::tar_make` is run with the `callr_function=NULL`, which allows for debugging. This only works if parallelization has been turned off in `scripts/targets-common.R` by setting the default controller to serial on line 51.
25
+
-`USE_SHINY` controls whether we start a Shiny server after producing the targets.
26
+
-`TAR_PROJECT` controls which `targets` project is run by `run.R`. Likely either `covid_hosp_explore` or `flu_hosp_explore`
27
+
-`EXTERNAL_SCORES_PATH` controls where external scores are loaded from. If not set, external scores are not used.
28
+
-`AWS_S3_PREFIX` controls the prefix to use in the AWS S3 bucket (a prefix is a pseudo-directory in a bucket).
30
29
31
30
Run the pipeline using:
32
31
33
32
```sh
34
-
# Install renv and R dependencies.
33
+
# Install renv and R dependencies
35
34
make install
36
35
37
36
# Pull pre-scored forecasts from the AWS bucket
38
-
make download
39
-
# or
40
37
make pull
41
38
42
39
# Run only the dashboard, to display results run on other machines
@@ -47,32 +44,23 @@ make run
47
44
# or in the background
48
45
make run-nohup
49
46
50
-
# Upload/push complete or partial results to the AWS bucket
51
-
make upload
52
-
# or
47
+
# Push complete or partial results to the AWS bucket
53
48
make push
54
49
```
55
50
56
-
-`EPIDATR_USE_CACHE` controls whether `epidatr` functions use the cache.
57
-
-`DEBUG_MODE` controls whether `targets::tar_make` is run with the `callr_function=NULL`, which allows for `browser()`. It also disables parallelization. If you are developing, it is recommended to set this to true. If you are just running, it is recommended to set it to false.
58
-
-`USE_SHINY` controls whether we start a Shiny server after producing the targets.
59
-
-`TAR_PROJECT` controls which `targets` project is run by `run.R`.
60
-
-`EXTERNAL_SCORES_PATH` controls where external scores are loaded from. If not set, external scores are not used.
61
-
-`AWS_S3_PREFIX` controls the prefix to use in the AWS S3 bucket (a prefix is a pseudo-directory in a bucket).
62
-
63
51
## Development
64
52
65
53
### Directory Layout
66
54
67
-
-`run.R` and `Makefile`: the main entrypoint for all pipelines
68
-
-`R/`: R package code to be reused
69
-
-`scripts/`: plotting, code, and misc.
70
-
-`tests/`: package tests
71
-
-`covid_hosp_explore/` and `covid_hosp_explore.R`: a `targets` project for exploring covid hospitalization forecasters
72
-
-`flu_hosp_explore/` and `flu_hosp_explore.R`: a `targets` project for exploring flu hospitalization forecasters
73
-
-`covid_hosp_prod/` and `covid_hosp_prod.R`: a `targets` project for predicting covid hospitalizations
74
-
-`flu_hosp_prod/` and `flu_hosp_prod.R`: a `targets` project for predicting flu hospitalizations
75
-
-`forecaster_testing/` and `forecaster_testing.R`: a `targets` project for testing forecasters
55
+
-`Makefile`: the main entrypoint for all pipelines
56
+
-`R/`: R package code to be reused
57
+
-`scripts/`: plotting, code, and misc.
58
+
-`tests/`: package tests
59
+
-`covid_hosp_explore/` and `scripts/covid_hosp_explore.R`: a `targets` project for exploring covid hospitalization forecasters
60
+
-`flu_hosp_explore/` and `scripts/flu_hosp_explore.R`: a `targets` project for exploring flu hospitalization forecasters
61
+
-`covid_hosp_prod/` and `scripts/covid_hosp_prod.R`: a `targets` project for predicting covid hospitalizations
62
+
-`flu_hosp_prod/` and `scripts/flu_hosp_prod.R`: a `targets` project for predicting flu hospitalizations
63
+
-`forecaster_testing/` and `scripts/forecaster_testing.R`: a `targets` project for testing forecasters
76
64
77
65
### Parallelization Gotchas
78
66
@@ -84,6 +72,7 @@ It is safest to develop with parallelism disabled.
84
72
Targets in parallel mode has two problems when it comes to debugging: 1) it ignores browsers, so you can't step through functions and 2) reloading any changes requires both `renv::install(".")` and restarting R.
85
73
86
74
To debug a target named `yourTarget`:
75
+
87
76
1. set `DEBUG_MODE=true`
88
77
2. insert a browser in the relevant function
89
78
3. run an R session, and call `tar_make(yourTarget)`
0 commit comments