Skip to content

Commit 8e74a87

Browse files
committed
doc: update README
1 parent 7e4c9a5 commit 8e74a87

File tree

2 files changed

+28
-22
lines changed

2 files changed

+28
-22
lines changed

R/utils.R

+3-5
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ get_exclusions <- function(
153153
}
154154
return("")
155155
}
156+
156157
data_substitutions <- function(dataset, disease, forecast_generation_date) {
157158
disease <- "flu"
158159
forecast_generation_date <- as.Date("2025-01-08")
@@ -169,6 +170,7 @@ data_substitutions <- function(dataset, disease, forecast_generation_date) {
169170
mutate(value = ifelse(!is.na(new_value), new_value, value)) %>%
170171
select(-new_value)
171172
}
173+
172174
parse_prod_weights <- function(filename = here::here("covid_geo_exclusions.csv"),
173175
gen_forecast_date) {
174176
all_states <- c(
@@ -198,6 +200,7 @@ parse_prod_weights <- function(filename = here::here("covid_geo_exclusions.csv")
198200
group_by(forecast_date, geo_value) %>%
199201
mutate(weight = ifelse(near(weight, 0), 0, weight / sum(weight)))
200202
}
203+
201204
exclude_geos <- function(geo_forecasters_weights) {
202205
geo_exclusions <- geo_forecasters_weights %>%
203206
group_by(forecast_date, geo_value) %>%
@@ -219,11 +222,6 @@ get_population_data <- function() {
219222
bind_rows((.) %>% filter(state_id == "us") %>% mutate(state_id = "usa"))
220223
}
221224

222-
# TODO:
223-
scale_pop <- function(df) {}
224-
225-
unscale_pop <- function(df) {}
226-
227225
filter_forecast_geos <- function(forecasts, truth_data) {
228226
subset_geos <- unique(forecasts$geo_value)
229227
# Bad forecast filters

README.md

+25-17
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ 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

7-
## Usage
7+
## Production Usage 2024-2025
8+
9+
The pipeline should run on a schedule and by ~10:45AM PST time, you should find the new reports on https://delphi-forecasting-reports.netlify.app/.
10+
If not, see the instructions below for manual running.
811

912
Define run parameters in your `.Renviron` file:
1013

@@ -41,21 +44,25 @@ make install
4144

4245
# Pull pre-scored forecasts from the AWS bucket
4346
make pull
44-
# or
45-
make download
4647

47-
# Run only the dashboard, to display results run on other machines
48-
make dashboard
48+
# Make forecasts
49+
make prod-flu
50+
make prod-covid
51+
52+
# The job output can be found in nohup.out
53+
# If there are errors, you can view them with the following command (replace with appropriate project)
54+
Sys.setenv(TAR_PROJECT = "covid_hosp_prod");
55+
targets::tar_meta(fields = error, complete_only = FALSE)
4956

50-
# Run the pipeline using the helper script `run.R`
51-
make run
52-
# or in the background
53-
make run-nohup
57+
# Automatically append the new reports to the site index and host the site on netlify
58+
# (this requires the netlify CLI to be installed and configured, talk to Dmitry about this)
59+
make update_site && make netlify
5460

55-
# Push complete or partial results to the AWS bucket
56-
make push
57-
# or
58-
make upload
61+
# Update weights until satisfied using *_geo_exclusions.csv, rerun the make command above
62+
# Submit (makes a commit, pushes to our fork, and makes a PR; this requires a GitHub token
63+
# and the gh CLI to be installed and configured, talk to Dmitry about this)
64+
make submit-flu
65+
make submit-covid
5966
```
6067

6168
## Development
@@ -74,11 +81,12 @@ make upload
7481

7582
### Debugging
7683

77-
Targets in parallel mode conflicts with debugging because it ignores `browser()` statements. To debug a target named `yourTarget`:
84+
Insert a `browser()` statements into the code you want to debug and then run
7885

79-
1. set `DEBUG_MODE=true` in `.Renviron`
80-
2. insert a browser in the relevant function
81-
3. run an R session and call `tar_make(yourTarget)`
86+
```r
87+
# use_crew=FALSE disables parallelization
88+
tar_make(target_name, callr_function = NULL, use_crew = FALSE)
89+
```
8290

8391
### Pipeline Design
8492

0 commit comments

Comments
 (0)