Skip to content

Add specialized epix_slide for epi_slide_opt #611

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

Open
wants to merge 108 commits into
base: dev
Choose a base branch
from
Open

Conversation

brookslogan
Copy link
Contributor

@brookslogan brookslogan commented Feb 26, 2025

Checklist

Please:

  • Make sure this PR is against "dev", not "main" (unless this is a release
    PR).
  • Request a review from one of the current main reviewers:
    brookslogan, nmdefries.
  • Makes sure to bump the version number in DESCRIPTION. Always increment
    the patch version number (the third number), unless you are making a
    release PR from dev to main, in which case increment the minor version
    number (the second number).
  • Describe changes made in NEWS.md, making sure breaking changes
    (backwards-incompatible changes to the documented interface) are noted.
    Collect the changes under the next release number (e.g. if you are on
    1.7.2, then write your changes under the 1.8 heading).
  • See DEVELOPMENT.md for more information on the development
    process.

Change explanations for reviewer

Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch

TODO

  • Address review comments
  • Address change in epi_slide_opt(.before = Inf) behavior from refactor (CHECK check not running at the moment despite some others running?)

@brookslogan
Copy link
Contributor Author

brookslogan commented Feb 26, 2025

@brookslogan brookslogan force-pushed the lcb/archive-agg branch 6 times, most recently from 2949de6 to 661cece Compare February 28, 2025 05:33
@brookslogan brookslogan force-pushed the lcb/archive-agg branch 15 times, most recently from 57dd9ea to 6dcf722 Compare March 7, 2025 01:30
@brookslogan brookslogan force-pushed the lcb/archive-agg branch 3 times, most recently from 1fbe7b8 to dd84924 Compare March 10, 2025 19:52
@brookslogan brookslogan marked this pull request as ready for review March 10, 2025 20:00
…chars

Something still seems different; some Date arithmetic stuck out, and attempts to
avoid helped somewhat, but this still seems slower for archives than pre-unified
approach.
As `vec_c` is slower on 3 scalar `Date`s, and it's probably pretty uncommon to
use `time_value`s with `c` incompatible with `vec_c` (though possible... maybe
tibbles with year, week, wday, like from MMWRweek; though these would probably
break inside archive DT).
Revert earlier change to try to reduce time inside `time_minus_time_in_n_steps`,
as `c.Date` is more costly.  This also works back towards generality from the
previous `vec_c` -> `c` change.
Also change a map -> lapply so we can get srcref to internal error immediately,
add a missed .window_size-missingness check, delete some helper functions that
were sort of helpful but also tacked on significant run time when used in a
natural way.
The error message says that slide computations can't be rownamed data frames.
This is both bad wording (having rownames != having non-automatic rownames) and
we're not actually enforcing any restriction of the sort anyway. We drop/ignore
the rownames though (via dplyr/tibble). In `epix_slide`, the allowance of
non-automatic rownames was deliberate; in `epi_slide`, it also seems likely the
way to go; one might convert to `data.frame` and have some filter-like operation
return non-automatic rownames.
Use `... =` to specify this.  Prevents some confusing error messages on
```
archive_cases_dv_subset %>%
  epi_slide_opt(percent_cli, frollmean, 0, .window_size = 7)
```
but does not solve all issues that can happen with unnamed `...`.
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.

Implement smart sparse archive -> archive slide
4 participants