Skip to content

Commit 974a7cb

Browse files
committed
hotfix: data subs, make Makefile commands consistent
1 parent 34ea3d7 commit 974a7cb

5 files changed

+27
-12
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ submit-flu-dry:
6060

6161
submit: submit-covid submit-flu
6262

63-
get_nwss:
63+
get-nwss:
6464
mkdir -p aux_data/nwss_covid_data; \
6565
mkdir -p aux_data/nwss_flu_data; \
6666
. .venv/bin/activate; \
@@ -90,14 +90,14 @@ upload: push
9090
dashboard:
9191
Rscript scripts/dashboard.R
9292

93-
update_site:
93+
update-site:
9494
Rscript -e "suppressPackageStartupMessages(source(here::here('R', 'load_all.R'))); update_site()" > cache/update_site_log.txt
9595

9696
netlify:
9797
netlify deploy --dir=reports --prod
9898

99-
get_flu_prod_errors:
99+
get-flu-prod-errors:
100100
Rscript -e "suppressPackageStartupMessages(source(here::here('R', 'load_all.R'))); get_targets_errors(project = 'flu_hosp_prod')"
101101

102-
get_covid_prod_errors:
102+
get-covid-prod-errors:
103103
Rscript -e "suppressPackageStartupMessages(source(here::here('R', 'load_all.R'))); get_targets_errors(project = 'covid_hosp_prod')"

covid_data_substitutions.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ sd, 2025-03-05, 2025-02-26, 35
66
ak, 2025-03-26, 2025-03-19, 15
77
ar, 2025-03-26, 2025-03-19, 85
88
ky, 2025-03-26, 2025-03-19, 130
9-
nj, 2025-03-26, 2025-03-19, 270
9+
nj, 2025-03-26, 2025-03-19, 270

covid_geo_exclusions.csv

+15
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ forecast_date,forecaster,geo_value,weight
1212
2024-10-01, climate_geo_agged, all, 0.5
1313
2024-10-01, climate_quantile_extrapolated, all, 0
1414
##################
15+
# April 2
16+
##################
17+
2025-04-02, all, mp, 0
18+
2025-04-02, windowed_seasonal, all, 0.0001
19+
2025-04-02, windowed_seasonal_extra_sources, all, 3
20+
2025-04-02, climate_linear, all, 0.0001
21+
2025-04-02, linear, all, 3
22+
2025-04-02, linearlog, all, 0
23+
2025-04-02, climate_base, all, 2
24+
2025-04-02, climate_geo_agged, all, 0.5
25+
2025-04-02, climate_quantile_extrapolated, all, 0
26+
# Make ar_only the most important for dc
27+
2025-04-02, windowed_seasonal, dc, 5
28+
2025-04-02, windowed_seasonal_extra_sources, dc, 5
29+
##################
1530
# March 26
1631
##################
1732
2025-03-26, all, mp, 0

flu_data_substitutions.csv

+1
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ dc, 2025-03-05, 2025-02-19, 130
1919
hi, 2025-03-05, 2025-02-26, 70
2020
nj, 2025-03-26, 2025-03-19, 260
2121
tn, 2025-03-26, 2025-03-19, 430
22+
nh, 2025-04-02, 2025-03-22, 80

scripts/build_nhsn_archive.R

+6-7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ suppressPackageStartupMessages({
3333
# Suppresses read_csv progress and column type messages
3434
options(readr.show_progress = FALSE)
3535
options(readr.show_col_types = FALSE)
36+
options(cli.width = 120)
3637

3738
# Script run time
3839
run_time <- with_tz(Sys.time(), tzone = "UTC")
@@ -154,7 +155,7 @@ process_nhsn_data_file <- function(key) {
154155
#' day. The archive has the columns geo_value, time_value, disease, endpoint
155156
#' (either basic or prelim), version, version_timestamp (to enable keeping the
156157
#' most recent value), and value.
157-
update_nhsn_data_archive <- function(verbose = FALSE) {
158+
update_nhsn_data_archive <- function() {
158159
# Get the last timestamp of the archive
159160
last_timestamp <- get_s3_object_last_modified(config$archive_s3_key, config$s3_bucket)
160161

@@ -181,12 +182,11 @@ update_nhsn_data_archive <- function(verbose = FALSE) {
181182
return(invisible(NULL))
182183
}
183184

184-
cli_inform("New datasets available at {run_time_local} (UTC: {run_time}).")
185-
cli_inform("Adding {nrow(new_data_files_latest_per_day)} new NHSN datasets to the archive.")
185+
cli_inform("New datasets available at, adding {nrow(new_data_files_latest_per_day)} new NHSN datasets to the archive.")
186186

187187
# Process each new dataset snapshot
188188
new_data <- new_data_files_latest_per_day$Key %>%
189-
map(process_nhsn_data_file, .progress = verbose) %>%
189+
map(process_nhsn_data_file, .progress = interactive()) %>%
190190
bind_rows()
191191

192192
# Look through the existing archive to see if there were updates today. If so, replace them with the new data.
@@ -204,12 +204,11 @@ update_nhsn_data_archive <- function(verbose = FALSE) {
204204
}
205205

206206
update_nhsn_data <- function(verbose = FALSE) {
207-
options(cli.width = 120)
208207
if (verbose) {
209208
cli_inform(glue("Checking for updates to NHSN data at {run_time_local} (UTC: {run_time})..."))
210209
}
211210
update_nhsn_data_raw()
212-
update_nhsn_data_archive(verbose = verbose)
211+
update_nhsn_data_archive()
213212
}
214213

215-
update_nhsn_data(verbose = TRUE)
214+
update_nhsn_data(verbose = TRUE)

0 commit comments

Comments
 (0)