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

Conversation

brookslogan
Copy link
Contributor

Replacement for #290 using branch from the correct remote.

`epix_slide` already has summarize/reframe-like column behavior: it outputs the
grouping columns + columns from the user computations. Make it also have
`reframe`-like row behavior:

* Accept any number of elements/rows out of user computations (instead of
  requiring either 1 or a particular number derived from an inferred/assumed
  "computation effective key").
* Do not recycle length-1 user computation outputs to the "expected" length/nrow.
Previously, broadcasting in `epix_slide` would remove any rows filled in by
`.drop=FALSE`, making the `.drop` setting more or less useless.  Now that
`epix_slide` does not broadcast, update docs&tests accordingly.  Additionally,
add some missing validation for the `.drop` parameter.

Other changes:
* Tweak code using `setDT` to do it in a pipe to read better (avoid a line
  setting an `out_DT` variable to a non-DT value, even temporarily).
* Format some roxygen comments.
@brookslogan
Copy link
Contributor Author

While we decide on when we should output epi_dfs and what their column naming and metadata should be, I'll make epix_slide only output (ungrouped, to match reframe) tibbles.

@brookslogan
Copy link
Contributor Author

brookslogan commented May 4, 2023

  • consider whether analogue should be group_modify rather than reframe, so we can match groupedness of epi_slide.

@brookslogan brookslogan changed the title Make epix_slide more like reframe Make epix_slide more like group_modify May 4, 2023
Copy link
Contributor

@nmdefries nmdefries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several questions and one logical branch that wasn't updated.

R/grouped_epi_archive.R Outdated Show resolved Hide resolved
R/grouped_epi_archive.R Show resolved Hide resolved
R/methods-epi_archive.R Outdated Show resolved Hide resolved
R/methods-epi_archive.R Outdated Show resolved Hide resolved
vignettes/advanced.Rmd Outdated Show resolved Hide resolved
vignettes/advanced.Rmd Outdated Show resolved Hide resolved
R/methods-epi_archive.R Outdated Show resolved Hide resolved
vignettes/advanced.Rmd Show resolved Hide resolved
nmdefries and others added 2 commits May 24, 2023 17:18
Document behavior when `all_rows = TRUE` and `as_list_col = TRUE`; this behavior
might be different from before move to use `vctrs` though.

Add tests to cover this case + others, which was caught only via a vignette
build failing.
@brookslogan
Copy link
Contributor Author

brookslogan commented May 27, 2023

Think this is now pretty much fixed up. Some remaining minor TODOs:

  • Update tests and NEWS.md on whether we now support Date column output from slide computations.
  • Update NEWS.md on whether the move to vctrs has a breaking change with all_rows = TRUE, as_list_col = TRUE. Or maybe just change to match the old behavior if current behavior is different. [There was a breaking change. Documented it in NEWS.md. With the epi_slide weirdness of as_list_col = TRUE think as_list_col needs to change more or be removed.]

@brookslogan
Copy link
Contributor Author

Checked with nmdefries on this and think it's ready to merge.

@brookslogan brookslogan merged commit 5436aa3 into dev May 30, 2023
2 checks passed
@brookslogan brookslogan deleted the lcb/make_epix_slide_more_like_reframe branch May 30, 2023 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants