Skip to content

Commit

Permalink
Merge pull request #530 from cmu-delphi/dev
Browse files Browse the repository at this point in the history
catch main up to dev, epiprocess 0.9.0
  • Loading branch information
dshemetov authored Sep 27, 2024
2 parents 16f38b2 + 44e7095 commit 7bf94e3
Show file tree
Hide file tree
Showing 97 changed files with 5,767 additions and 3,839 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
^.lintr$
^DEVELOPMENT.md$
man-roxygen
^.venv$
^sandbox.R$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ docs
renv/
renv.lock
.Rprofile
sandbox.R
43 changes: 26 additions & 17 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Type: Package
Package: epiprocess
Title: Tools for basic signal processing in epidemiology
Version: 0.8.0
Version: 0.9.0
Authors@R: c(
person("Jacob", "Bien", role = "ctb"),
person("Logan", "Brooks", email = "[email protected]", role = c("aut", "cre")),
person("Logan", "Brooks", , "[email protected]", role = c("aut", "cre")),
person("Rafael", "Catoia", role = "ctb"),
person("Nat", "DeFries", role = "ctb"),
person("Daniel", "McDonald", role = "aut"),
Expand All @@ -15,23 +15,30 @@ Authors@R: c(
person("Evan", "Ray", role = "aut"),
person("Dmitry", "Shemetov", role = "ctb"),
person("Ryan", "Tibshirani", role = "aut"),
person("Lionel", "Henry", role = "ctb", comment = "Author of included rlang fragments"),
person("Hadley", "Wickham", role = "ctb", comment = "Author of included rlang fragments"),
person("Posit", role = "cph", comment = "Copyright holder of included rlang fragments")
person("Lionel", "Henry", role = "ctb",
comment = "Author of included rlang fragments"),
person("Hadley", "Wickham", role = "ctb",
comment = "Author of included rlang fragments"),
person("Posit", role = "cph",
comment = "Copyright holder of included rlang fragments")
)
Description: This package introduces a common data structure for epidemiological
data reported by location and time, provides another data structure to
work with revisions to these data sets over time, and offers associated
utilities to perform basic signal processing tasks.
Description: This package introduces a common data structure for
epidemiological data reported by location and time, provides another
data structure to work with revisions to these data sets over time,
and offers associated utilities to perform basic signal processing
tasks.
License: MIT + file LICENSE
Copyright: file inst/COPYRIGHTS
URL: https://cmu-delphi.github.io/epiprocess/
Depends:
R (>= 3.6)
Imports:
checkmate,
cli,
data.table,
dplyr (>= 1.0.0),
dplyr (>= 1.0.8),
genlasso,
ggplot2,
glue,
lifecycle (>= 1.0.1),
lubridate,
magrittr,
Expand All @@ -43,7 +50,8 @@ Imports:
tidyselect (>= 1.2.0),
tsibble,
utils,
vctrs
vctrs,
waldo
Suggests:
covidcast,
devtools,
Expand All @@ -57,22 +65,22 @@ VignetteBuilder:
knitr
Remotes:
cmu-delphi/epidatr,
reconverse/outbreaks,
glmgen/genlasso
glmgen/genlasso,
reconverse/outbreaks
Config/testthat/edition: 3
Config/testthat/parallel: true
Copyright: file inst/COPYRIGHTS
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Depends:
R (>= 2.10)
URL: https://cmu-delphi.github.io/epiprocess/
Collate:
'archive.R'
'autoplot.R'
'correlation.R'
'data.R'
'epi_df.R'
'epi_df_forbidden_methods.R'
'epiprocess.R'
'group_by_epi_df_methods.R'
'methods-epi_archive.R'
Expand All @@ -82,6 +90,7 @@ Collate:
'methods-epi_df.R'
'outliers.R'
'reexports.R'
'revision_analysis.R'
'slide.R'
'utils.R'
'utils_pipe.R'
31 changes: 30 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

S3method("[",epi_df)
S3method("names<-",epi_df)
S3method(Summary,epi_df)
S3method(arrange_canonical,default)
S3method(arrange_canonical,epi_df)
S3method(arrange_col_canonical,default)
S3method(arrange_col_canonical,epi_df)
S3method(arrange_row_canonical,default)
S3method(arrange_row_canonical,epi_df)
S3method(as_epi_df,data.frame)
S3method(as_epi_df,epi_df)
S3method(as_epi_df,tbl_df)
Expand All @@ -11,6 +18,7 @@ S3method(as_tsibble,epi_df)
S3method(autoplot,epi_df)
S3method(clone,epi_archive)
S3method(clone,grouped_epi_archive)
S3method(complete,epi_df)
S3method(dplyr_col_modify,col_modify_recorder_df)
S3method(dplyr_col_modify,epi_df)
S3method(dplyr_reconstruct,epi_df)
Expand All @@ -24,6 +32,7 @@ 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(group_vars,grouped_epi_archive)
S3method(groups,grouped_epi_archive)
S3method(guess_period,Date)
S3method(guess_period,POSIXt)
Expand All @@ -32,24 +41,26 @@ S3method(key_colnames,data.frame)
S3method(key_colnames,default)
S3method(key_colnames,epi_archive)
S3method(key_colnames,epi_df)
S3method(mean,epi_df)
S3method(next_after,Date)
S3method(next_after,integer)
S3method(print,epi_archive)
S3method(print,epi_df)
S3method(print,grouped_epi_archive)
S3method(select,epi_df)
S3method(summary,epi_df)
S3method(ungroup,epi_df)
S3method(ungroup,grouped_epi_archive)
S3method(unnest,epi_df)
export("%>%")
export(archive_cases_dv_subset)
export(arrange)
export(arrange_canonical)
export(as_epi_archive)
export(as_epi_df)
export(as_tsibble)
export(autoplot)
export(clone)
export(complete)
export(detect_outlr)
export(detect_outlr_rm)
export(detect_outlr_stl)
Expand All @@ -64,8 +75,10 @@ export(epix_merge)
export(epix_slide)
export(epix_truncate_versions_after)
export(filter)
export(full_seq)
export(geo_column_names)
export(group_by)
export(group_epi_df)
export(group_modify)
export(growth_rate)
export(guess_period)
Expand All @@ -79,7 +92,9 @@ export(new_epi_df)
export(next_after)
export(relocate)
export(rename)
export(revision_summary)
export(slice)
export(sum_groups_epi_df)
export(time_column_names)
export(ungroup)
export(unnest)
Expand Down Expand Up @@ -109,6 +124,7 @@ importFrom(checkmate,vname)
importFrom(cli,cat_line)
importFrom(cli,cli_abort)
importFrom(cli,cli_inform)
importFrom(cli,cli_li)
importFrom(cli,cli_vec)
importFrom(cli,cli_warn)
importFrom(cli,format_message)
Expand All @@ -126,25 +142,35 @@ importFrom(data.table,set)
importFrom(data.table,setDF)
importFrom(data.table,setkeyv)
importFrom(dplyr,"%>%")
importFrom(dplyr,across)
importFrom(dplyr,all_of)
importFrom(dplyr,arrange)
importFrom(dplyr,bind_rows)
importFrom(dplyr,c_across)
importFrom(dplyr,dplyr_col_modify)
importFrom(dplyr,dplyr_reconstruct)
importFrom(dplyr,dplyr_row_slice)
importFrom(dplyr,everything)
importFrom(dplyr,filter)
importFrom(dplyr,group_by)
importFrom(dplyr,group_by_drop_default)
importFrom(dplyr,group_map)
importFrom(dplyr,group_modify)
importFrom(dplyr,group_vars)
importFrom(dplyr,groups)
importFrom(dplyr,if_all)
importFrom(dplyr,if_any)
importFrom(dplyr,if_else)
importFrom(dplyr,lag)
importFrom(dplyr,mutate)
importFrom(dplyr,near)
importFrom(dplyr,pick)
importFrom(dplyr,pull)
importFrom(dplyr,relocate)
importFrom(dplyr,rename)
importFrom(dplyr,select)
importFrom(dplyr,slice)
importFrom(dplyr,summarize)
importFrom(dplyr,tibble)
importFrom(dplyr,ungroup)
importFrom(ggplot2,autoplot)
Expand Down Expand Up @@ -176,6 +202,7 @@ importFrom(rlang,is_formula)
importFrom(rlang,is_function)
importFrom(rlang,is_missing)
importFrom(rlang,is_quosure)
importFrom(rlang,list2)
importFrom(rlang,missing_arg)
importFrom(rlang,new_function)
importFrom(rlang,quo_get_expr)
Expand All @@ -194,6 +221,8 @@ importFrom(stats,median)
importFrom(tibble,as_tibble)
importFrom(tibble,new_tibble)
importFrom(tibble,validate_tibble)
importFrom(tidyr,complete)
importFrom(tidyr,full_seq)
importFrom(tidyr,unnest)
importFrom(tidyselect,any_of)
importFrom(tidyselect,eval_select)
Expand Down
81 changes: 70 additions & 11 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,74 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat

# epiprocess 0.9

## Breaking changes

- `epi_slide` interface has major breaking changes.
- All variables are now dot-prefixed to be more consistent with tidyverse
style for functions that allow tidyeval.
- The `before/after` arguments have been replaced with the `.window_size` and
`.align` arguments.
- `names_sep` has been removed. If you return data frames from your
computations:
- without a name, they will be unpacked into separate columns without name
prefixes
- with a name, it will become a packed data.frame-class column (see
`tidyr::pack`).
- `as_list_col` has been removed. You can now directly return a list from your
slide computations instead. If you were using `as_list_col=TRUE`, you will
need to wrap your output in a list.
- Ungrouped slides are no longer allowed in `epi_slide`. If you used this for
geographic aggregation up to national, consider using `sum_groups_epi_df`.
- Added `sum_groups_epi_df` to allow aggregation across key columns prior to
sliding.
- `epix_slide` interface has major changes.
- All variables are now dot-prefixed to be more consistent with tidyverse
style for functions that allow tidyeval.
- `names_sep` has been removed. If you return data frames from your
computations:
- without a name, they will be unpacked into separate columns without name
prefixes
- with a name, it will become a packed data.frame-class column (see
`tidyr::pack`).
- `as_list_col` has been removed. You can now directly return a list from your
slide computations instead. If you were using `as_list_col=TRUE`, you will
need to wrap your output in a list.
- `as_epi_df()` now checks that every group has unique time values and errors if
this is not the case. The same check is performed at the beginning of
`epi_slide()`. This check is currently not enforced in dplyr operations (like
for joins, mutates, or select), but we plan to add it in the future.
- `as_epi_df()` or `as_epi_archive()` no longer accept `additional_metadata`.
Use the new `other_keys` arg to specify additional key columns, such as age
group columns or other demographic breakdowns. Miscellaneous metadata are no
longer handled by `epiprocess`, but you can use R's built-in `attr<-` instead
for a similar feature.

## Improvements

- Added `complete.epi_df`, which fills in missing values in an `epi_df` with
`NA`s. Uses `tidyr::complete` underneath and preserves `epi_df` metadata.
- Inclusion of the function `revision_summary` to provide basic revision
information for `epi_archive`s out of the box. (#492)

## Bug fixes

- Fix `epi_slide_opt` (and related functions) to correctly handle `before=Inf`.
Also allow multiple columns specified as a list of strings.
- Disallow `after=Inf` in slide functions, since it doesn't seem like a likely
use case and complicates code.

# epiprocess 0.8

## Breaking changes

- `epi_df`'s are now more strict about what types they allow in the time column.
Namely, we are explicit about only supporting `Date` at the daily and weekly
cadence and generic integer types (for yearly cadence).
- `epi_slide` `before` and `after` arguments are now require the user to
specific time units in certain cases. The `time_step` argument has been
removed.
- `epix_slide` `before` argument now defaults to `Inf`, and requires the user to
specify units in some cases. The `time_step` argument has been removed.
- `detect_outlr_stl(seasonal_period = NULL)` is no longer accepted. Use
`detect_outlr_stl(seasonal_period = <value>, seasonal_as_residual = TRUE)`
instead. See `?detect_outlr_stl` for more details.
Expand Down Expand Up @@ -50,6 +114,12 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
are similar functions for `geo` and `version`).
- Fixed bug where `epix_slide_ref_time_values_default()` on datetimes would
output a huge number of `ref_time_values` spaced apart by mere seconds.
- In `epi_slide()` and `epix_slide()`:
- Multiple "data-masking" tidy evaluation expressions can be passed in via
`...`, rather than just one.
- Additional tidy evaluation features from `dplyr::mutate` are supported: `!!
name_var := value`, unnamed expressions evaluating to data frames, and `=
NULL`; see `?epi_slide` for more details.

## Cleanup

Expand All @@ -58,17 +128,6 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
of `epi_df`s to let `{epipredict}` work more easily with other libraries (#471).
- Removed some external package dependencies.

## Breaking Changes

- `epi_df`'s are now more strict about what types they allow in the time column.
Namely, we are explicit about only supporting `Date` at the daily and weekly
cadence and generic integer types (for yearly cadence).
- `epi_slide` `before` and `after` arguments are now require the user to
specific time units in certain cases. The `time_step` argument has been
removed.
- `epix_slide` `before` argument now defaults to `Inf`, and requires the user to
specify units in some cases. The `time_step` argument has been removed.

# epiprocess 0.7.0

## Breaking changes:
Expand Down
Loading

0 comments on commit 7bf94e3

Please sign in to comment.