Skip to content

Commit e49d428

Browse files
committed
lint: formatting
1 parent 8e74a87 commit e49d428

6 files changed

+3
-26
lines changed

R/forecasters/data_transforms.R

-4
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ extend_ahead <- function(epi_data, ahead) {
153153
return(list(epi_data, effective_ahead))
154154
}
155155

156-
157156
#' get the Taylor expansion coefficients for a vector of values
158157
#' @param values the vector of values to interpolate
159158
#' @param degree the degree of the polynomial
@@ -233,7 +232,6 @@ calculate_whitening_params <- function(
233232
return(learned_params)
234233
}
235234

236-
237235
#' scale so that every data source has the same 95th quantile
238236
data_whitening <- function(epi_data, colname, learned_params, nonlin_method = c("quart_root", "none"), join_cols = NULL) {
239237
if (is.null(learned_params)) {
@@ -273,7 +271,6 @@ data_coloring <- function(epi_data, colname, learned_params, nonlin_method = c("
273271
res %>% select(-ends_with("_center"), -ends_with("_scale"))
274272
}
275273

276-
277274
#' the distance between two integers/dates, mod m e.g. mod_dist(1,9,10) = 2
278275
mod_dist <- function(a, b, m) {
279276
pmin(as.integer(a - b) %% m, as.integer(b - a) %% m)
@@ -354,7 +351,6 @@ climate_median <- function(epi_data, target, ahead, window_size = 3, recent_wind
354351
)
355352
}
356353

357-
358354
#' add the first principal component for each season_week to epi_data, shifted
359355
#' by ahead
360356
#' @description

R/forecasters/epipredict_utilities.R

-3
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ get_oversized_test_data <- function(full_data, test_data_interval, preproc, sour
154154
arrange(time_value)
155155
}
156156

157-
158-
159-
160157
epi_as_of <- function(epi_dataframe) {
161158
attributes(epi_dataframe)$metadata$as_of
162159
}

R/forecasters/forecaster_baseline_linear.R

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ forecaster_baseline_linear <- function(epi_data, ahead, log = FALSE, sort = FALS
88
left_join(population_data, by = "geo_value") %>%
99
mutate(value = value / population * 10**5)
1010

11-
1211
if (log) {
1312
df_processed <- df_processed %>% mutate(value = log(value))
1413
}

R/forecasters/forecaster_flatline.R

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ flatline_fc <- function(epi_data,
5858
if (is.null(true_forecast_date)) {
5959
true_forecast_date <- max(epi_data$time_value)
6060
}
61-
res$predictions
6261
pred <- format_storage(res$predictions, true_forecast_date)
6362
pred %<>% mutate(forecast_date = true_forecast_date)
6463
# (geo_value, forecast_date, target_end_date, quantile, value)

R/forecasters/formatters.R

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
#' @export
1515
format_storage <- function(pred, true_forecast_date, target_end_date) {
1616
pred %>%
17-
mutate(
18-
.dstn = nested_quantiles(.pred_distn)
19-
) %>%
17+
mutate(.dstn = nested_quantiles(.pred_distn)) %>%
2018
unnest(.dstn) %>%
2119
select(-any_of(c(".pred_distn", ".pred", "time_value"))) %>%
2220
rename(quantile = quantile_levels, value = values) %>%

scripts/covid_hosp_prod.R

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# The COVID Hospitalization Production Forecasting Pipeline.
2-
#
3-
42
source("scripts/targets-common.R")
53

64
submission_directory <- Sys.getenv("COVID_SUBMISSION_DIRECTORY", "cache")
@@ -31,18 +29,8 @@ forecaster_fns <- list2(
3129
)
3230

3331
rlang::list2(
34-
tar_target(
35-
aheads,
36-
command = {
37-
-1:3
38-
}
39-
),
40-
tar_target(
41-
forecasters,
42-
command = {
43-
seq_along(forecaster_fns)
44-
}
45-
),
32+
tar_target(aheads, command = -1:3),
33+
tar_target(forecasters, command = seq_along(forecaster_fns)),
4634
tar_map(
4735
values = tidyr::expand_grid(
4836
tibble(

0 commit comments

Comments
 (0)