Skip to content

Commit 6a5d240

Browse files
committed
doc+fix: update README, Makefile, minor lint
1 parent bd10b01 commit 6a5d240

File tree

6 files changed

+23
-55
lines changed

6 files changed

+23
-55
lines changed

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Imports:
2121
epipredict,
2222
epiprocess,
2323
here,
24+
jsonlite,
2425
lubridate,
2526
magrittr,
2627
parsnip (>= 1.0.0),

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ run-nohup:
1414
sync:
1515
Rscript scripts/sync.R
1616

17-
download:
17+
pull:
1818
Rscript scripts/sync.R download
1919

20-
pull: download
21-
22-
upload:
20+
push:
2321
Rscript scripts/sync.R upload
2422

25-
push: upload
26-
2723
dashboard:
2824
Rscript scripts/dashboard.R
2925

README.md

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Exploration Tooling
22

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.
44
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.
55
The repo is also structured as an R package, which means that it is easy to share code between different targets.
66

@@ -12,7 +12,6 @@ Define run parameters:
1212
# Save to your `.Renviron` file:
1313
EPIDATR_USE_CACHE=true
1414
# not strictly necessary, but you probably want a long cache time, since this is for the historical data
15-
EPIDATR_CACHE_DIR=~/.epidatr-cache
1615
EPIDATR_CACHE_MAX_AGE_DAYS=42
1716
DEBUG_MODE=false
1817
USE_SHINY=false
@@ -21,22 +20,20 @@ EXTERNAL_SCORES_PATH=legacy-exploration-scorecards.qs
2120
AWS_S3_PREFIX=exploration
2221
```
2322

24-
- `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).
3029

3130
Run the pipeline using:
3231

3332
```sh
34-
# Install renv and R dependencies.
33+
# Install renv and R dependencies
3534
make install
3635

3736
# Pull pre-scored forecasts from the AWS bucket
38-
make download
39-
# or
4037
make pull
4138

4239
# Run only the dashboard, to display results run on other machines
@@ -47,32 +44,23 @@ make run
4744
# or in the background
4845
make run-nohup
4946

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
5348
make push
5449
```
5550

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-
6351
## Development
6452

6553
### Directory Layout
6654

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
7664

7765
### Parallelization Gotchas
7866

@@ -84,6 +72,7 @@ It is safest to develop with parallelism disabled.
8472
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.
8573

8674
To debug a target named `yourTarget`:
75+
8776
1. set `DEBUG_MODE=true`
8877
2. insert a browser in the relevant function
8978
3. run an R session, and call `tar_make(yourTarget)`

man/locf_latency.Rd

Lines changed: 0 additions & 17 deletions
This file was deleted.

scripts/covid_hosp_prod.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rlang::list2(
2626
tar_target(
2727
aheads,
2828
command = {
29-
7 * 1:4
29+
1:28
3030
}
3131
),
3232
tar_target(

scripts/geo_exclusions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"exclusions":
33
{
4-
"2024-03-24": "ak,ca"
54
}
65
}

0 commit comments

Comments
 (0)