Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make epix_slide more like group_modify #311

Merged
merged 33 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d6b2639
Clarify archive grouping-related documentation
lcbrooks Mar 17, 2023
9a092af
Update epix_slide code to have `reframe`-like row behavior
lcbrooks Mar 16, 2023
d2edb2e
Add missing `grouped_epi_archive` test file
lcbrooks Mar 20, 2023
bf99f30
Update `.drop`+`epix_slide` given `reframe`-like `epix_slide`
lcbrooks Mar 20, 2023
74631af
If `epix_slide` outputs an `epi_df`, use `versions_end` for `as_of`
lcbrooks Mar 20, 2023
8039ed3
Update checks to also run on PRs (but not pushes) to `dev`
lcbrooks Mar 21, 2023
9d10b5f
Fix missing quotes in _pkgdown.yml
lcbrooks Mar 24, 2023
b8f768a
Update `epi[x]_slide` comparisons given epix like `reframe`
lcbrooks Mar 28, 2023
953717f
Remove `all_rows` for `epix_slide`; add deprecation tests
lcbrooks Mar 28, 2023
cb195c2
Always output ungrouped, no-metadata tibble from `epix_slide`, `as_ti…
lcbrooks May 4, 2023
b7a07e4
Refactor `ref_time_values` calc, test 0-row `f` outputs in `epix_slide`
lcbrooks May 4, 2023
c06f3ee
Fix DESCRIPTION version, update NEWS.md with `epix_slide` changes
lcbrooks May 4, 2023
b02b3a1
Change `epix_slide` to be more analogous to `group_modify`
lcbrooks May 4, 2023
442f3e9
Fix `epix_slide` `as_list_col=TRUE` outputting df-type col not list
lcbrooks May 5, 2023
e440a18
Add `epix_slide`-like-`group_modify` migration notes in NEWS.md
lcbrooks May 5, 2023
134b47c
Fixm roxygen copy-paste error for `group_modify`
lcbrooks May 5, 2023
a4baf7a
Address non-ASCII character issue from `check()`
lcbrooks May 5, 2023
6d0f060
Fix `guess_period` `@param` names
lcbrooks May 5, 2023
21a090b
Fix `as_tibble.epi_df` docs, make it have its own topic
lcbrooks May 5, 2023
6efd823
Fix `group_modify.epi_df` roxygen typo + missing `@param`s
lcbrooks May 5, 2023
a047b07
repl(epix_slide): describe migration in `all_rows` deprecation
lcbrooks May 19, 2023
26e9d2c
refactor: favor validation section over validation + `else if`
lcbrooks May 19, 2023
dbb658c
Fix epix_slide warning class naming inconsistencies
lcbrooks May 19, 2023
af49aae
Fix missing word in `advanced.Rmd` basic usage description
lcbrooks May 19, 2023
60ada45
Remove remaining references to `comp_effective_key_vars`
lcbrooks May 24, 2023
80d29c6
Add missing `epix_slide` tests for {fn,~,tidy} x {all_versions,not}
lcbrooks May 24, 2023
f70b911
Reword advanced.Rmd on epi vs epix slide number of output rows
lcbrooks May 24, 2023
de398b1
Track missing .Rd file
lcbrooks May 24, 2023
8985db2
Make `as_list_col=TRUE` consistent for vecs and dfs from slide comps
lcbrooks May 24, 2023
2014016
Merge branch 'dev' into lcb/make_epix_slide_more_like_reframe
nmdefries May 24, 2023
9ba843c
Fix `all_rows = TRUE` to work with move to `vctrs`
lcbrooks May 27, 2023
cf2ad2f
Update tests&NEWS.md about `epi_slide` `f` Date vec output
lcbrooks May 30, 2023
116bae0
Add NEWS.md entry for `as_list_col` `all_rows` `NA` -> `NULL`
lcbrooks May 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
branches: [main, master, dev]

name: R-CMD-check

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
branches: [main, master, dev]
release:
types: [published]
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: epiprocess
Title: Tools for basic signal processing in epidemiology
Version: 0.6.0
Version: 0.6.0.9999
Authors@R: c(
person("Jacob", "Bien", role = "ctb"),
person("Logan", "Brooks", role = "aut"),
Expand Down Expand Up @@ -62,7 +62,7 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Depends:
R (>= 2.10)
URL: https://cmu-delphi.github.io/epiprocess/
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ S3method(as_epi_df,data.frame)
S3method(as_epi_df,epi_df)
S3method(as_epi_df,tbl_df)
S3method(as_epi_df,tbl_ts)
S3method(as_tibble,epi_df)
S3method(as_tsibble,epi_df)
S3method(dplyr_col_modify,col_modify_recorder_df)
S3method(dplyr_col_modify,epi_df)
Expand All @@ -17,6 +18,7 @@ S3method(group_by,epi_archive)
S3method(group_by,epi_df)
S3method(group_by,grouped_epi_archive)
S3method(group_by_drop_default,grouped_epi_archive)
S3method(group_modify,epi_df)
S3method(groups,grouped_epi_archive)
S3method(next_after,Date)
S3method(next_after,integer)
Expand Down Expand Up @@ -99,6 +101,7 @@ importFrom(rlang,sym)
importFrom(rlang,syms)
importFrom(stats,cor)
importFrom(stats,median)
importFrom(tibble,as_tibble)
importFrom(tidyr,unnest)
importFrom(tidyselect,eval_select)
importFrom(tidyselect,starts_with)
Expand Down
22 changes: 22 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@ Note that `epiprocess` uses the [Semantic Versioning
("semver")](https://semver.org/) scheme for all release versions, but any
inter-release development versions will include an additional ".9999" suffix.

## Breaking changes:

* `epix_slide` has been made more like `dplyr::group_modify`. It will no longer
perform element/row recycling for size stability, accepts slide computation
outputs containing any number of rows, and no longer supports `all_rows`.
* To keep the old behavior, manually perform row recycling within `f`
computations, and/or `left_join` a data frame representing the desired
output structure with the current `epix_slide()` result to obtain the
desired repetitions and completions expected with `all_rows = TRUE`.
* `epix_slide` will only output grouped or ungrouped tibbles. Previously, it
would sometimes output `epi_df`s, but not consistently, and not always with
the metadata desired. Future versions will revisit this design, and consider
more closely whether/when/how to output an `epi_df`.
* To keep the old behavior, convert the output of `epix_slide()` to `epi_df`
when desired and set the metadata appropriately.

## Improvements:

* `epi_slide` and `epix_slide` now support `as_list_col = TRUE` when the slide
computations output atomic vectors, and output a list column in "chopped"
format (see `tidyr::chop`).

# epiprocess 0.6.0

## Breaking changes:
Expand Down
6 changes: 3 additions & 3 deletions R/archive.R
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ epi_archive =
Abort("compactify must be boolean or null.")
}

# Apply defaults and conduct checks and apply defaults for
# Apply defaults and conduct checks for
# `clobberable_versions_start`, `versions_end`:
if (missing(clobberable_versions_start)) {
clobberable_versions_start <- NA
Expand Down Expand Up @@ -640,7 +640,7 @@ epi_archive =
slide = function(f, ..., before, ref_time_values,
time_step, new_col_name = "slide_value",
as_list_col = FALSE, names_sep = "_",
all_rows = FALSE, all_versions = FALSE) {
all_versions = FALSE) {
# For an "ungrouped" slide, treat all rows as belonging to one big
# group (group by 0 vars), like `dplyr::summarize`, and let the
# resulting `grouped_epi_archive` handle the slide:
Expand All @@ -649,7 +649,7 @@ epi_archive =
before = before, ref_time_values = ref_time_values,
time_step = time_step, new_col_name = new_col_name,
as_list_col = as_list_col, names_sep = names_sep,
all_rows = all_rows, all_versions = all_versions
all_versions = all_versions
) %>%
# We want a slide on ungrouped archives to output something
# ungrouped, rather than retaining the trivial (0-variable)
Expand Down
Loading