Skip to content

Commit 9590724

Browse files
authored
Merge pull request #617 from cmu-delphi/dev
merge dev -> main
2 parents f454f0c + ca98924 commit 9590724

File tree

84 files changed

+3889
-2388
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+3889
-2388
lines changed

.github/workflows/doc-preview.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
on:
2+
issue_comment:
3+
types: [created]
4+
5+
name: doc-preview.yaml
6+
7+
permissions: read-all
8+
9+
jobs:
10+
preview:
11+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/preview-docs') }}
12+
13+
runs-on: ubuntu-latest
14+
permissions:
15+
# Needed to write a comment on the PR
16+
pull-requests: write
17+
# Needed to read the PR branch
18+
contents: read
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
# Checkout the PR branch
23+
ref: refs/pull/${{ github.event.issue.number }}/head
24+
25+
- uses: r-lib/actions/setup-pandoc@v2
26+
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
30+
31+
- uses: r-lib/actions/setup-r-dependencies@v2
32+
with:
33+
extra-packages: any::pkgdown, local::.
34+
needs: website
35+
36+
- name: Build site
37+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
38+
shell: Rscript {0}
39+
40+
- name: Deploy to Netlify
41+
uses: nwtgck/[email protected]
42+
with:
43+
# Standard config
44+
github-token: ${{ secrets.GITHUB_TOKEN }}
45+
deploy-message: "Deploy from GitHub Actions"
46+
# 'docs/' is the default directory for pkgdown::build_site()
47+
# we add 'dev' because _pkgdown.yml has 'development: mode: devel'
48+
publish-dir: './docs/dev'
49+
# Development deploys only
50+
production-deploy: false
51+
# Enable pull request comment (default)
52+
enable-pull-request-comment: true
53+
# Overwrite the pull request comment with updated link (default)
54+
overwrites-pull-request-comment: true
55+
# Don't deploy to GitHub
56+
enable-github-deployment: false
57+
# Don't update the status of the commit
58+
enable-commit-status: false
59+
# Don't comment on the commit
60+
enable-commit-comment: false
61+
env:
62+
# Netlify credentials (currently from Dmitry's account)
63+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
64+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
65+
timeout-minutes: 1

.lintr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
linters: linters_with_defaults(
22
line_length_linter(120),
3-
cyclocomp_linter = NULL,
43
object_length_linter(length = 40L)
54
)
65
exclusions: list(

DESCRIPTION

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Package: epiprocess
21
Type: Package
2+
Package: epiprocess
33
Title: Tools for basic signal processing in epidemiology
4-
Version: 0.10.0
4+
Version: 0.11.0
55
Authors@R: c(
66
person("Jacob", "Bien", role = "ctb"),
77
person("Logan", "Brooks", , "[email protected]", role = c("aut", "cre")),
@@ -23,60 +23,65 @@ Authors@R: c(
2323
person("Posit", role = "cph",
2424
comment = "Copyright holder of included rlang fragments"),
2525
person("Johns Hopkins University Center for Systems Science and Engineering", role = "dtc",
26-
comment = "Owner of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
26+
comment = "Owner of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
2727
person("Johns Hopkins University", role = "cph",
28-
comment = "Copyright holder of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
28+
comment = "Copyright holder of COVID-19 cases and deaths data from the COVID-19 Data Repository"),
2929
person("Carnegie Mellon University Delphi Group", role = "dtc",
30-
comment = "Owner of claims-based CLI data from the Delphi Epidata API")
30+
comment = "Owner of claims-based CLI data from the Delphi Epidata API")
3131
)
32-
Description: This package introduces common data structures for working with
33-
epidemiological data reported by location and time and offers associated
34-
utilities to perform basic signal processing tasks. The package is designed
35-
to be used in conjunction with `epipredict` for building and evaluating
36-
epidemiological models.
32+
Description: This package introduces common data structures for working
33+
with epidemiological data reported by location and time and offers
34+
associated utilities to perform basic signal processing tasks. The
35+
package is designed to be used in conjunction with `epipredict` for
36+
building and evaluating epidemiological models.
3737
License: MIT + file LICENSE
3838
URL: https://cmu-delphi.github.io/epiprocess/
3939
Depends:
40+
epidatasets,
4041
R (>= 3.6)
4142
Imports:
4243
checkmate,
4344
cli,
4445
data.table,
4546
dplyr (>= 1.1.0),
46-
epidatasets,
47-
genlasso,
4847
ggplot2,
4948
glue,
5049
lifecycle (>= 1.0.1),
5150
lubridate,
5251
magrittr,
52+
pkgconfig,
5353
purrr,
5454
rlang,
5555
slider,
5656
tibble,
5757
tidyr,
5858
tidyselect (>= 1.2.0),
59+
tools,
5960
tsibble,
6061
utils,
6162
vctrs,
6263
waldo
6364
Suggests:
6465
devtools,
66+
distributional,
6567
epidatr,
68+
epipredict,
6669
here,
6770
knitr,
6871
outbreaks,
6972
readr,
7073
rmarkdown,
7174
testthat (>= 3.1.5),
75+
trendfilter,
7276
withr
7377
VignetteBuilder:
7478
knitr
7579
Remotes:
7680
cmu-delphi/delphidocs,
7781
cmu-delphi/epidatasets,
7882
cmu-delphi/epidatr,
79-
glmgen/genlasso,
83+
cmu-delphi/epipredict,
84+
glmgen/trendfilter,
8085
reconverse/outbreaks
8186
Config/Needs/website: cmu-delphi/delphidocs
8287
Config/testthat/edition: 3
@@ -103,5 +108,6 @@ Collate:
103108
'reexports.R'
104109
'revision_analysis.R'
105110
'slide.R'
111+
'time-utils.R'
106112
'utils.R'
107113
'utils_pipe.R'

NAMESPACE

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
S3method("$<-",epi_df)
34
S3method("[",epi_df)
5+
S3method("[<-",epi_df)
6+
S3method("[[<-",epi_df)
47
S3method("names<-",epi_df)
58
S3method(Summary,epi_df)
69
S3method(arrange_canonical,default)
@@ -39,31 +42,27 @@ S3method(guess_period,Date)
3942
S3method(guess_period,POSIXt)
4043
S3method(guess_period,default)
4144
S3method(key_colnames,data.frame)
42-
S3method(key_colnames,default)
4345
S3method(key_colnames,epi_archive)
4446
S3method(key_colnames,epi_df)
47+
S3method(key_colnames,tbl_ts)
4548
S3method(mean,epi_df)
4649
S3method(print,epi_archive)
4750
S3method(print,epi_df)
4851
S3method(print,grouped_epi_archive)
52+
S3method(print,growth_rate_params)
4953
S3method(summary,epi_df)
5054
S3method(ungroup,epi_df)
5155
S3method(ungroup,grouped_epi_archive)
5256
S3method(unnest,epi_df)
5357
export("%>%")
54-
export(archive_cases_dv_subset)
5558
export(arrange)
5659
export(arrange_canonical)
5760
export(as_epi_archive)
5861
export(as_epi_df)
5962
export(as_tsibble)
6063
export(autoplot)
61-
export(cases_deaths_subset)
6264
export(clone)
6365
export(complete)
64-
export(covid_case_death_rates_extended)
65-
export(covid_incidence_county_subset)
66-
export(covid_incidence_outliers)
6766
export(deprecated_quo_is_present)
6867
export(detect_outlr)
6968
export(detect_outlr_rm)
@@ -85,6 +84,7 @@ export(group_by)
8584
export(group_epi_df)
8685
export(group_modify)
8786
export(growth_rate)
87+
export(growth_rate_params)
8888
export(guess_period)
8989
export(is_epi_df)
9090
export(is_grouped_epi_archive)
@@ -114,6 +114,7 @@ importFrom(checkmate,assert_function)
114114
importFrom(checkmate,assert_int)
115115
importFrom(checkmate,assert_list)
116116
importFrom(checkmate,assert_logical)
117+
importFrom(checkmate,assert_number)
117118
importFrom(checkmate,assert_numeric)
118119
importFrom(checkmate,assert_scalar)
119120
importFrom(checkmate,assert_string)
@@ -135,6 +136,8 @@ importFrom(cli,cli_li)
135136
importFrom(cli,cli_vec)
136137
importFrom(cli,cli_warn)
137138
importFrom(cli,format_message)
139+
importFrom(cli,pluralize)
140+
importFrom(cli,qty)
138141
importFrom(data.table,":=")
139142
importFrom(data.table,address)
140143
importFrom(data.table,as.data.table)
@@ -143,6 +146,7 @@ importFrom(data.table,copy)
143146
importFrom(data.table,frollapply)
144147
importFrom(data.table,frollmean)
145148
importFrom(data.table,frollsum)
149+
importFrom(data.table,is.data.table)
146150
importFrom(data.table,key)
147151
importFrom(data.table,rbindlist)
148152
importFrom(data.table,set)
@@ -152,7 +156,6 @@ importFrom(dplyr,"%>%")
152156
importFrom(dplyr,across)
153157
importFrom(dplyr,all_of)
154158
importFrom(dplyr,arrange)
155-
importFrom(dplyr,bind_rows)
156159
importFrom(dplyr,c_across)
157160
importFrom(dplyr,dplyr_col_modify)
158161
importFrom(dplyr,dplyr_reconstruct)
@@ -164,14 +167,14 @@ importFrom(dplyr,group_by_drop_default)
164167
importFrom(dplyr,group_map)
165168
importFrom(dplyr,group_modify)
166169
importFrom(dplyr,group_vars)
170+
importFrom(dplyr,grouped_df)
167171
importFrom(dplyr,groups)
168172
importFrom(dplyr,if_all)
169173
importFrom(dplyr,if_any)
170174
importFrom(dplyr,if_else)
171175
importFrom(dplyr,is_grouped_df)
172176
importFrom(dplyr,lag)
173177
importFrom(dplyr,mutate)
174-
importFrom(dplyr,near)
175178
importFrom(dplyr,pick)
176179
importFrom(dplyr,pull)
177180
importFrom(dplyr,relocate)
@@ -188,6 +191,7 @@ importFrom(lubridate,as.period)
188191
importFrom(lubridate,days)
189192
importFrom(lubridate,weeks)
190193
importFrom(magrittr,"%>%")
194+
importFrom(purrr,list_rbind)
191195
importFrom(purrr,map)
192196
importFrom(purrr,map_lgl)
193197
importFrom(rlang,"!!!")
@@ -199,13 +203,16 @@ importFrom(rlang,arg_match)
199203
importFrom(rlang,caller_arg)
200204
importFrom(rlang,caller_env)
201205
importFrom(rlang,check_dots_empty)
206+
importFrom(rlang,check_dots_empty0)
207+
importFrom(rlang,dots_n)
202208
importFrom(rlang,enquo)
203209
importFrom(rlang,enquos)
204210
importFrom(rlang,env)
205211
importFrom(rlang,expr_label)
206212
importFrom(rlang,f_env)
207213
importFrom(rlang,f_rhs)
208214
importFrom(rlang,is_bare_integerish)
215+
importFrom(rlang,is_bare_numeric)
209216
importFrom(rlang,is_environment)
210217
importFrom(rlang,is_formula)
211218
importFrom(rlang,is_function)
@@ -236,8 +243,20 @@ importFrom(tidyr,unnest)
236243
importFrom(tidyselect,any_of)
237244
importFrom(tidyselect,eval_select)
238245
importFrom(tidyselect,starts_with)
246+
importFrom(tools,toTitleCase)
239247
importFrom(tsibble,as_tsibble)
240248
importFrom(utils,capture.output)
241249
importFrom(utils,tail)
250+
importFrom(vctrs,"vec_slice<-")
251+
importFrom(vctrs,vec_cast)
242252
importFrom(vctrs,vec_data)
253+
importFrom(vctrs,vec_duplicate_any)
243254
importFrom(vctrs,vec_equal)
255+
importFrom(vctrs,vec_in)
256+
importFrom(vctrs,vec_order)
257+
importFrom(vctrs,vec_rbind)
258+
importFrom(vctrs,vec_recycle_common)
259+
importFrom(vctrs,vec_rep)
260+
importFrom(vctrs,vec_size)
261+
importFrom(vctrs,vec_slice)
262+
importFrom(vctrs,vec_sort)

NEWS.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,73 @@
22

33
Pre-1.0.0 numbering scheme: 0.x will indicate releases, while 0.x.y will indicate PR's.
44

5+
# epiprocess 0.11
6+
7+
## Breaking changes
8+
9+
- `growth_rate()` argument order and names have changed. You will need to
10+
rewrite `growth_rate(x, y)` as `growth_rate(y, x)`. The interface for passing
11+
arguments to the `"smooth_spline"` and `"trend_filter"` methods has also
12+
changed. Finally, `growth_rate()` with `method = "trendfilter"` now uses the
13+
`{trendfilter}` package rather than `{genlasso}`; results for this method will
14+
be different than before. In order to make `{epiprocess}` installation easier
15+
for users without a compiler, we have placed `{trendfilter}` in Suggests:; if
16+
you want to use `method = "trendfilter"` you will need to manually install
17+
this dependency (e.g., with `remotes::install_github("glmgen/trendfilter")`).
18+
- In `revision_summary()`:
19+
- The `should_compactify` argument is now called `compactify`. To migrate,
20+
change any calls with `should_compactfiy =` to `compactify =`.
21+
- Output now uses the name `lag_near_latest` instead of `time_near_latest`. To
22+
migrate, update references to `time_near_latest` to `lag_near_latest`.
23+
- `revision_summary(epi_arch)` without specifying the measurement column to
24+
analyze in `...` will no longer attempt to guess which one you intended if
25+
there are multiple possibilities to choose from (#571). If you attempt a
26+
complicated tidyselection that selects zero columns, this is also now an
27+
error. If you encounter such errors, manually specify the measurement column
28+
in `...`.
29+
- `min_waiting_period` now defines a nonstrict inequality instead of a strict
30+
one. To obtain the old bounds, bump the `min_waiting_period` up to the next
31+
possible value for your `time_type`.
32+
- In `key_colnames()`:
33+
- On regular (non-`epi_df`) data frames, now requires manual specification of
34+
`geo_keys`, `other_keys`, and `time_keys`.
35+
- The `extra_keys` argument has been deprecated and replaced with
36+
`other_keys`.
37+
- The compactification tolerance argument has been renamed to
38+
`compactify_abs_tol` or `abs_tol`, depending on the function; now defines a
39+
nonstrict tolerances; and defaults to 0 (requiring exact matches in order to
40+
compactify). This argument has been added to `as_epi_archive()` and
41+
`epix_merge()` and removed (along with all compactification options) from
42+
`new_epi_archive()`.
43+
- `validate_epi_archive()` now follows the validator convention of operating on
44+
an "unvalidated" `epi_archive` (from `new_epi_archive`) rather than arguments.
45+
46+
## Improvements
47+
- `revision_summary()` now supports all `time_type`s.
48+
- The compactification tolerance setting now works with integer-type columns.
49+
- Various functions are now faster, using faster variants of core operations and
50+
avoiding reconstructing grouped `epi_df`s when unnecessary.
51+
52+
## Bug fixes
53+
54+
- Fixed aggregation of age-group-specific rates to overall rates in `epi_df` vignette (#587).
55+
- Fixed `key_colnames()` omitting some key columns on `epi_archive`s (#565).
56+
- Fixed `epi_archive` compactification raising an error on certain value column
57+
classes such as `"distribution"` (#541); it's now easier to form an archive of
58+
forecasts in that format.
59+
- Fixed large compactification tolerances potentially removing all versions of
60+
some observations in certain cases when activity was flat.
61+
- `[<-`, `[[<-`, and `$<-` now properly retain `epi_df`-ness when used on
62+
grouped `epi_df`s.
63+
64+
## Cleanup
65+
66+
- Moved example datasets from being reexported in the package to being fetched
67+
from `epidatasets`. The `epidatasets` package is now auto-loaded as a
68+
dependency of `epiprocess`. The datasets can still be accessed, after loading
69+
the package, with `data()` or the name of the dataset alone, or with
70+
`epidatasets::` (#577).
71+
572
# epiprocess 0.10
673

774
## Breaking changes

0 commit comments

Comments
 (0)