Skip to content

Commit

Permalink
updating after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
dsweber2 committed Oct 1, 2024
1 parent b3c96b3 commit 86c46a4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 52 deletions.
2 changes: 0 additions & 2 deletions R/arx_classifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,5 +370,3 @@ print.arx_class <- function(x, ...) {
name <- "ARX Classifier"
NextMethod(name = name, ...)
}

# this is a trivial change to induce a check
8 changes: 4 additions & 4 deletions R/utils-latency.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,11 @@ pad_to_end <- function(x, groups, end_date, columns_to_complete = NULL) {
}
itval <- epiprocess:::guess_period(c(x$time_value, end_date), "time_value")
# get the time values we need to fill in
completed_time_values <-
x %>%
completed_time_values <- x %>%
group_by(across(all_of(groups))) %>%
summarise(
time_value = list2(
time_value = seq_null_swap(from = max(time_value) + itval, to = end_date, by = itval)
time_value = seq_forward(from = max(time_value) + itval, to = end_date, by = itval)
)
) %>%
unnest("time_value") %>%
Expand All @@ -197,6 +196,7 @@ pad_to_end <- function(x, groups, end_date, columns_to_complete = NULL) {
grouped_and_arranged <- x %>%
arrange(across(all_of(c("time_value", groups)))) %>%
group_by(across(all_of(groups)))

values_to_fill <- grouped_and_arranged %>%
slice(min(across(all_of(columns_to_complete), count_single_column)):n())
filled_values <- values_to_fill %>%
Expand All @@ -222,7 +222,7 @@ count_single_column <- function(col) {

#' seq, but returns null if from is larger
#' @keywords internal
seq_null_swap <- function(from, to, by) {
seq_forward <- function(from, to, by) {
if (from > to) {
return(NULL)
}
Expand Down
11 changes: 11 additions & 0 deletions R/utils-misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,14 @@ is_classification <- function(trainer) {
is_regression <- function(trainer) {
get_parsnip_mode(trainer) %in% c("regression", "unknown")
}


enlist <- function(...) {
# converted to thin wrapper around
rlang::dots_list(
...,
.homonyms = "error",
.named = TRUE,
.check_assign = TRUE
)
}
6 changes: 3 additions & 3 deletions man/seq_null_swap.Rd → man/seq_forward.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/step_adjust_latency.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-get_test_data.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
library(dplyr)
suppressPackageStartupMessages(library(dplyr))
test_that("return expected number of rows and returned dataset is ungrouped", {
r <- epi_recipe(case_death_rate_subset) %>%
step_epi_ahead(death_rate, ahead = 7) %>%
Expand Down
37 changes: 0 additions & 37 deletions tests/testthat/test-pad_to_end.R

This file was deleted.

6 changes: 3 additions & 3 deletions tests/testthat/test-step_epi_naomit.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library(dplyr)
library(parsnip)
library(workflows)
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(parsnip))
suppressPackageStartupMessages(library(workflows))

# Random generated dataset
x <- tibble(
Expand Down

0 comments on commit 86c46a4

Please sign in to comment.