Skip to content

Commit

Permalink
Merge pull request #431 from cmu-delphi/ds/r6-clean
Browse files Browse the repository at this point in the history
wip feat: replace R6 `epi_archive` with S3 implementation
  • Loading branch information
brookslogan committed May 3, 2024
2 parents 4e65e51 + e61e11a commit eec777f
Show file tree
Hide file tree
Showing 45 changed files with 1,658 additions and 2,480 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ Imports:
lubridate,
magrittr,
purrr,
R6,
rlang,
slider,
tibble,
Expand All @@ -50,12 +49,12 @@ Imports:
vctrs
Suggests:
covidcast,
devtools,
epidatr,
knitr,
outbreaks,
rmarkdown,
testthat (>= 3.1.5),
waldo (>= 0.3.1),
withr
VignetteBuilder:
knitr
Expand Down
24 changes: 20 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ S3method(as_epi_df,tbl_ts)
S3method(as_tibble,epi_df)
S3method(as_tsibble,epi_df)
S3method(autoplot,epi_df)
S3method(clone,epi_archive)
S3method(clone,grouped_epi_archive)
S3method(dplyr_col_modify,col_modify_recorder_df)
S3method(dplyr_col_modify,epi_df)
S3method(dplyr_reconstruct,epi_df)
S3method(dplyr_row_slice,epi_df)
S3method(epix_slide,epi_archive)
S3method(epix_slide,grouped_epi_archive)
S3method(epix_truncate_versions_after,epi_archive)
S3method(epix_truncate_versions_after,grouped_epi_archive)
S3method(group_by,epi_archive)
Expand All @@ -27,7 +31,9 @@ S3method(key_colnames,epi_archive)
S3method(key_colnames,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)
Expand All @@ -40,37 +46,38 @@ export(as_epi_archive)
export(as_epi_df)
export(as_tsibble)
export(autoplot)
export(clone)
export(detect_outlr)
export(detect_outlr_rm)
export(detect_outlr_stl)
export(epi_archive)
export(epi_cor)
export(epi_slide)
export(epi_slide_mean)
export(epi_slide_opt)
export(epi_slide_sum)
export(epix_as_of)
export(epix_fill_through_version)
export(epix_merge)
export(epix_slide)
export(epix_truncate_versions_after)
export(filter)
export(group_by)
export(group_modify)
export(growth_rate)
export(is_epi_archive)
export(is_epi_df)
export(is_grouped_epi_archive)
export(key_colnames)
export(max_version_with_row_in)
export(mutate)
export(new_epi_archive)
export(new_epi_df)
export(next_after)
export(relocate)
export(rename)
export(slice)
export(ungroup)
export(unnest)
importFrom(R6,R6Class)
export(validate_epi_archive)
importFrom(checkmate,anyInfinite)
importFrom(checkmate,anyMissing)
importFrom(checkmate,assert)
Expand All @@ -86,12 +93,16 @@ importFrom(checkmate,assert_scalar)
importFrom(checkmate,checkInt)
importFrom(checkmate,check_atomic)
importFrom(checkmate,check_data_frame)
importFrom(checkmate,check_names)
importFrom(checkmate,expect_class)
importFrom(checkmate,test_set_equal)
importFrom(checkmate,test_subset)
importFrom(checkmate,vname)
importFrom(cli,cat_line)
importFrom(cli,cli_abort)
importFrom(cli,cli_inform)
importFrom(cli,cli_vec)
importFrom(cli,cli_warn)
importFrom(cli,format_message)
importFrom(data.table,":=")
importFrom(data.table,address)
importFrom(data.table,as.data.table)
Expand All @@ -111,12 +122,15 @@ importFrom(dplyr,bind_rows)
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_modify)
importFrom(dplyr,group_vars)
importFrom(dplyr,groups)
importFrom(dplyr,if_all)
importFrom(dplyr,if_any)
importFrom(dplyr,mutate)
importFrom(dplyr,relocate)
importFrom(dplyr,rename)
Expand All @@ -133,12 +147,14 @@ importFrom(purrr,map)
importFrom(purrr,map_lgl)
importFrom(rlang,"!!!")
importFrom(rlang,"!!")
importFrom(rlang,"%||%")
importFrom(rlang,.data)
importFrom(rlang,.env)
importFrom(rlang,arg_match)
importFrom(rlang,as_label)
importFrom(rlang,caller_arg)
importFrom(rlang,caller_env)
importFrom(rlang,check_dots_empty)
importFrom(rlang,enquo)
importFrom(rlang,enquos)
importFrom(rlang,env)
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicat
## Breaking changes

- Switched `epi_df`'s `other_keys` default from `NULL` to `character(0)`; PR #390
- Refactored `epi_archive` to use S3 instead of R6 for its object model. The
functionality stay the same, but it will break the member function interface.
For migration, you can usually just convert `epi_archive$merge(...)` to
`epi_archive <- epi_archive %>% epix_merge(...)` (and the same for
`fill_through_version` and `truncate_after_version`) and
`epi_archive$slide(...)` to `epi_archive %>% epix_slide(...)` (and the same
for `as_of`, `group_by`, `slide`, etc.) (#340). In some limited situations,
such as if you have a helper function that calls `epi_archive$merge` etc. on
one of its arguments, then you may need to more carefully refactor them.

# epiprocess 0.7.0

Expand Down
Loading

0 comments on commit eec777f

Please sign in to comment.