Skip to content

Commit 02fe0c9

Browse files
authored
DRYify Map And Forecast Functions (#71)
* attempt to dryify code * update function description * attempt to try review comments * make return statements explicit; change param order; update params; add line breaks * run devtools document * add dhm suggested edits * typos edit * run devtools document
1 parent cfad627 commit 02fe0c9

20 files changed

+622
-544
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ repos:
4848
args: ['--baseline', '.secrets.baseline']
4949
exclude: package.lock.json
5050
- repo: https://github.com/crate-ci/typos
51-
rev: v1
51+
rev: v1.39.1
5252
hooks:
5353
- id: typos
5454
args: ["--force-exclude"]

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Description: This package provides functions to help with the maintenance of CDC
99
License: Apache License (>= 2)
1010
Encoding: UTF-8
1111
Roxygen: list(markdown = TRUE)
12-
RoxygenNote: 7.3.2
12+
RoxygenNote: 7.3.3
1313
Imports:
1414
checkmate,
1515
cli,

NAMESPACE

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ export(excluded_locations)
66
export(generate_hub_baseline)
77
export(generate_hub_ensemble)
88
export(generate_oracle_output)
9-
export(get_forecast_data)
109
export(get_hub_name)
11-
export(get_map_data)
1210
export(included_locations)
11+
export(summarize_ref_date_forecasts)
1312
export(update_authorized_users)
1413
export(update_hub_target_data)
14+
export(write_ref_date_summary)
15+
export(write_ref_date_summary_all)
16+
export(write_ref_date_summary_ens)
1517
importFrom(rlang,":=")
1618
importFrom(rlang,.data)

R/check_authorized_users.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ check_authorized_users <- function(
8484
cli::cli_inform(
8585
"Success: Changes authorized for user '{gh_actor}'."
8686
)
87-
invisible()
87+
return(invisible())
8888
}

R/check_changes_for_autoapproval.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ check_changes_for_autoapproval <- function(
7474
)
7575
}
7676

77-
invisible()
77+
return(invisible())
7878
}

R/generate_hub_baselines.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,5 +246,5 @@ generate_hub_baseline <- function(
246246
)
247247
)
248248

249-
invisible()
249+
return(invisible())
250250
}

R/generate_hub_ensemble.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,5 @@ generate_hub_ensemble <- function(
165165
median_ensemble_outputs,
166166
fs::path(output_dirpath, output_filename, ext = "csv")
167167
)
168-
invisible()
168+
return(invisible())
169169
}

R/generate_oracle_output.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@ generate_oracle_output <- function(hub_path) {
108108

109109
output_file <- fs::path(output_dirpath, "oracle-output", ext = "parquet")
110110
forecasttools::write_tabular_file(oracle_data, output_file)
111-
invisible()
111+
return(invisible())
112112
}

R/get_forecast_data.R

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

0 commit comments

Comments
 (0)