Skip to content

Commit ec30c2f

Browse files
committed
lockfile and formatting
1 parent 2c36d3b commit ec30c2f

File tree

2 files changed

+106
-77
lines changed

2 files changed

+106
-77
lines changed

R/utils.R

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,9 @@ make_ensemble_grid <- function(tib) {
149149
#'
150150
#' @export
151151
get_exclusions <- function(
152-
date,
153-
forecaster,
154-
exclusions_json = here::here("scripts", "geo_exclusions.json")
155-
) {
152+
date,
153+
forecaster,
154+
exclusions_json = here::here("scripts", "geo_exclusions.json")) {
156155
if (!file.exists(exclusions_json)) {
157156
return("")
158157
}
@@ -740,20 +739,19 @@ get_unique <- function(forecasts, min_locations = 50, min_dates = 40) {
740739
)
741740
# decide which of the forecasters has enough locations
742741
to_keep <- distinct %>%
743-
map_lgl( \(x) {
744-
(nrow(distinct(x,geo_value)) >= min_locations) &
745-
(nrow(distinct(x,forecast_date)) >= min_dates)
746-
}
747-
)
742+
map_lgl(\(x) {
743+
(nrow(distinct(x, geo_value)) >= min_locations) &
744+
(nrow(distinct(x, forecast_date)) >= min_dates)
745+
})
748746
if (all(!to_keep)) {
749747
max_geos <- distinct %>%
750-
map_int( \(x) {
751-
nrow(distinct(x,geo_value))
748+
map_int(\(x) {
749+
nrow(distinct(x, geo_value))
752750
}) %>%
753751
max()
754752
max_dates <- distinct %>%
755-
map_int( \(x) {
756-
nrow(distinct(x,forecast_date))
753+
map_int(\(x) {
754+
nrow(distinct(x, forecast_date))
757755
}) %>%
758756
max()
759757
cli::cli_abort("there are at most {max_geos} locations and {max_dates} dates. Adjust `min_locations` and/or `min_dates`.")

0 commit comments

Comments
 (0)