Skip to content

Commit 3c677ef

Browse files
committed
Update slide refactor todos
1 parent 573fc9b commit 3c677ef

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

R/slide-refactor.R

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ time_slide_to_simple_hopper <- function(.slide_comp, ..., .before_n_steps, .afte
1414
available_ref_time_values <- vec_slice(grp_data$time_value, ref_inds)
1515
i <<- 0L
1616
wrapped_slide_comp <- function(.x, .group_key, ...) {
17+
# XXX could just use enclosing dots rather than forwarding through hop()
1718
i <<- i + 1L
1819
# XXX could also use .after_n_steps to figure out...
19-
20-
# FIXME wrong dots here?
2120
.slide_comp(.x, .group_key, available_ref_time_values[[i]], ...)
2221
}
2322
if (.before_n_steps == Inf) {
@@ -124,13 +123,14 @@ upstream_slide_to_simple_hopper <- function(.f, ..., .in_colnames, .out_colnames
124123
grp_data
125124
}
126125
},
127-
slider = function(grp_data, grp_key, ref_inds) {
128-
for (col_i in seq_along(in_colnames)) {
129-
grp_data[[out_colnames[[col_i]]]] <- f_dots_baked(grp_data[[in_colnames[[col_i]]]], before = .before_n_steps, after = .after_n_steps)
130-
}
131-
grp_data
132-
},
133-
# TODO Inf checks?
126+
slider =
127+
# TODO Inf checks?
128+
function(grp_data, grp_key, ref_inds) {
129+
for (col_i in seq_along(in_colnames)) {
130+
grp_data[[out_colnames[[col_i]]]] <- f_dots_baked(grp_data[[in_colnames[[col_i]]]], before = .before_n_steps, after = .after_n_steps)
131+
}
132+
grp_data
133+
},
134134
stop("unsupported package")
135135
)
136136
}
@@ -140,3 +140,7 @@ upstream_slide_to_simple_hopper <- function(.f, ..., .in_colnames, .out_colnames
140140
# TODO decide whether/where to put time range stuff
141141

142142
# TODO grp_ -> ek_ ?
143+
144+
# TODO "hopper" -> "hop"
145+
146+
# TODO tacking on output columns -> outputting output columns

0 commit comments

Comments
 (0)