Skip to content

Commit b20f72e

Browse files
committed
merge dev, document
Merge branch 'dev' into main-to-dev # Conflicts: # .github/workflows/pkgdown.yaml # DESCRIPTION # R/layer_population_scaling.R # R/step_population_scaling.R # _pkgdown.yml # man/layer_population_scaling.Rd # man/step_population_scaling.Rd # tests/testthat/test-arg_is_.R # tests/testthat/test-check-training-set.R # tests/testthat/test-population_scaling.R # tests/testthat/test-snapshots.R # tests/testthat/test-target_date_bug.R
2 parents de231a9 + 2c021dc commit b20f72e

File tree

181 files changed

+4475
-2003
lines changed

Some content is hidden

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

181 files changed

+4475
-2003
lines changed

.Rbuildignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@
2020
^doc$
2121
^Meta$
2222
^.lintr$
23-
^.venv$
23+
^.venv$
24+
^inst/templates$

DESCRIPTION

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Package: epipredict
22
Title: Basic epidemiology forecasting methods
3-
Version: 0.1.0
3+
Version: 0.1.5
44
Authors@R: c(
55
person("Daniel J.", "McDonald", , "[email protected]", role = c("aut", "cre")),
66
person("Ryan", "Tibshirani", , "[email protected]", role = "aut"),
7-
person("Dmitry", "Shemetov", email = "[email protected]", role = "aut"),
8-
person("David", "Weber", email = "[email protected]", role = "aut"),
7+
person("Dmitry", "Shemetov", , "[email protected]", role = "aut"),
8+
person("David", "Weber", , "[email protected]", role = "aut"),
99
person("Delphi Research Group", role = c("cph", "fnd")),
1010
person("Logan", "Brooks", role = "aut"),
1111
person("Rachel", "Lobay", role = "aut"),
@@ -24,6 +24,7 @@ URL: https://github.com/cmu-delphi/epipredict/,
2424
https://cmu-delphi.github.io/epipredict
2525
BugReports: https://github.com/cmu-delphi/epipredict/issues/
2626
Depends:
27+
epidatasets,
2728
epiprocess (>= 0.9.0),
2829
parsnip (>= 1.0.0),
2930
R (>= 3.5.0)
@@ -48,7 +49,6 @@ Imports:
4849
vctrs,
4950
workflows (>= 1.0.0)
5051
Suggests:
51-
covidcast,
5252
data.table,
5353
epidatr (>= 1.0.0),
5454
fs,
@@ -60,6 +60,7 @@ Suggests:
6060
quantreg,
6161
ranger,
6262
RcppRoll,
63+
readr,
6364
rmarkdown,
6465
smoothqr,
6566
testthat (>= 3.0.0),
@@ -69,11 +70,12 @@ VignetteBuilder:
6970
knitr
7071
Remotes:
7172
cmu-delphi/delphidocs,
73+
cmu-delphi/epidatasets,
7274
cmu-delphi/epidatr,
7375
cmu-delphi/epiprocess,
7476
dajmcdon/smoothqr
75-
Config/testthat/edition: 3
7677
Config/Needs/website: cmu-delphi/delphidocs
78+
Config/testthat/edition: 3
7779
Encoding: UTF-8
7880
LazyData: true
7981
Roxygen: list(markdown = TRUE)

DEVELOPMENT.md

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
## Setting up the development environment
22

33
```r
4-
install.packages(c('devtools', 'pkgdown', 'styler', 'lintr')) # install dev dependencies
5-
devtools::install_deps(dependencies = TRUE) # install package dependencies
6-
devtools::document() # generate package meta data and man files
7-
devtools::build() # build package
4+
install.packages(c('devtools', 'pkgdown', 'styler', 'lintr', 'pak')) # install dev dependencies
5+
pak::pkg_install(".") # install package and dependencies
86
```
97

108
## Validating the package
@@ -13,33 +11,71 @@ devtools::build() # build package
1311
styler::style_pkg() # format code
1412
lintr::lint_package() # lint code
1513

14+
devtools::check() # run R CMD check, which runs everything below
15+
devtools::document() # generate package meta data and man files
1616
devtools::test() # test package
17-
devtools::check() # check package for errors
17+
devtools::build_vignettes() # build vignettes only
18+
devtools::run_examples() # run doc examples
19+
devtools::check(vignettes = FALSE) # check package without vignettes
1820
```
1921

2022
## Developing the documentation site
2123

22-
The [documentation site](https://cmu-delphi.github.io/epipredict/) is built off of the `main` branch. The `dev` version of the site is available at https://cmu-delphi.github.io/epipredict/dev.
23-
24-
The documentation site can be previewed locally by running in R
25-
26-
```r
27-
pkgdown::build_site(preview=TRUE)
28-
```
24+
Our CI builds two versions of the documentation:
2925

30-
The `main` version is available at `file:///<local path>/epidatr/epipredict/index.html` and `dev` at `file:///<local path>/epipredict/docs/dev/index.html`.
26+
- https://cmu-delphi.github.io/epipredict/ from the `main` branch and
27+
- https://cmu-delphi.github.io/epipredict/dev from the `dev` branch.
3128

32-
You can also build the docs manually and launch the site with python. From the terminal, this looks like
29+
Commands for developing the documentation site:
3330

34-
```bash
31+
```sh
32+
# Basic build and preview
33+
R -e 'pkgdown::clean_site()'
3534
R -e 'devtools::document()'
36-
python -m http.server -d docs
35+
R -e 'pkgdown::build_site()'
3736
```
3837

38+
If you work without R Studio and want to iterate on documentation, you might
39+
find [this
40+
script](https://gist.github.com/gadenbuie/d22e149e65591b91419e41ea5b2e0621)
41+
helpful.
42+
3943
## Versioning
4044

4145
Please follow the guidelines in the [PR template document](.github/pull_request_template.md).
4246

43-
## Release process
47+
## Planned CRAN release process
48+
49+
Open a release issue and then copy and follow this checklist in the issue (modified from the checklist generated by `usethis::use_release_issue(version = "1.0.2")`):
50+
51+
- [ ] `git pull` on `dev` branch.
52+
- [ ] Make sure all changes are committed and pushed.
53+
- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epipredict.html).
54+
- [ ] `devtools::check(".", manual = TRUE, env_vars = c(NOT_CRAN = "false"))`.
55+
- Aim for 10/10, no notes.
56+
- [ ] If check works well enough, merge to main. Otherwise open a PR to fix up.
57+
- [ ] [Polish NEWS](https://github.com/cmu-delphi/epipredict/blob/dev/NEWS.md).
58+
- Some [guidelines](https://style.tidyverse.org/news.html#news-release).
59+
- [ ] `git checkout main`
60+
- [ ] `git pull`
61+
- [ ] `urlchecker::url_check()`.
62+
- This may choke on the MIT license url, and that's ok.
63+
- [ ] `devtools::build_readme()`
64+
- [ ] `devtools::check_win_devel()`
65+
- [ ] Have maintainer ("cre" in description) check email for problems.
66+
- [ ] `revdepcheck::revdep_check(num_workers = 4)`.
67+
- This may choke, it is very sensitive to the binary versions of packages on a given system. Either bypass or ask someone else to run it if you're concerned.
68+
- [ ] Update `cran-comments.md`
69+
- [ ] PR with any changes (and go through the list again) into `dev` and run through the list again.
70+
71+
Submit to CRAN:
72+
73+
- [ ] `devtools::submit_cran()`.
74+
- [ ] Maintainer approves email.
75+
76+
Wait for CRAN...
4477

45-
TBD
78+
- [ ] If accepted :tada:, move to next steps. If rejected, fix and resubmit.
79+
- [ ] Open and merge a PR containing any updates made to `main` back to `dev`.
80+
- [ ] `usethis::use_github_release(publish = FALSE)` (publish off, otherwise it won't push) will create a draft release based on the commit hash in CRAN-SUBMISSION and push a tag to the GitHub repo.
81+
- [ ] Go to the repo, verify the release notes, and publish when ready.

NAMESPACE

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ S3method(autoplot,canned_epipred)
1919
S3method(autoplot,epi_workflow)
2020
S3method(bake,check_enough_train_data)
2121
S3method(bake,epi_recipe)
22+
S3method(bake,step_adjust_latency)
2223
S3method(bake,step_epi_ahead)
2324
S3method(bake,step_epi_lag)
2425
S3method(bake,step_epi_slide)
2526
S3method(bake,step_growth_rate)
2627
S3method(bake,step_lag_difference)
28+
S3method(bake,step_panel_normalize)
2729
S3method(bake,step_population_scaling)
2830
S3method(bake,step_training_window)
2931
S3method(detect_layer,frosting)
@@ -58,11 +60,13 @@ S3method(predict,epi_workflow)
5860
S3method(predict,flatline)
5961
S3method(prep,check_enough_train_data)
6062
S3method(prep,epi_recipe)
63+
S3method(prep,step_adjust_latency)
6164
S3method(prep,step_epi_ahead)
6265
S3method(prep,step_epi_lag)
6366
S3method(prep,step_epi_slide)
6467
S3method(prep,step_growth_rate)
6568
S3method(prep,step_lag_difference)
69+
S3method(prep,step_panel_normalize)
6670
S3method(prep,step_population_scaling)
6771
S3method(prep,step_training_window)
6872
S3method(print,alist)
@@ -87,12 +91,14 @@ S3method(print,layer_quantile_distn)
8791
S3method(print,layer_residual_quantiles)
8892
S3method(print,layer_threshold)
8993
S3method(print,layer_unnest)
94+
S3method(print,step_adjust_latency)
9095
S3method(print,step_epi_ahead)
9196
S3method(print,step_epi_lag)
9297
S3method(print,step_epi_slide)
9398
S3method(print,step_growth_rate)
9499
S3method(print,step_lag_difference)
95100
S3method(print,step_naomit)
101+
S3method(print,step_panel_normalize)
96102
S3method(print,step_population_scaling)
97103
S3method(print,step_training_window)
98104
S3method(quantile,dist_quantiles)
@@ -118,6 +124,7 @@ S3method(snap,distribution)
118124
S3method(tidy,check_enough_train_data)
119125
S3method(tidy,frosting)
120126
S3method(tidy,layer)
127+
S3method(tidy,step_panel_normalize)
121128
S3method(update,layer)
122129
S3method(vec_ptype_abbr,dist_quantiles)
123130
S3method(vec_ptype_full,dist_quantiles)
@@ -195,12 +202,14 @@ export(remove_frosting)
195202
export(remove_model)
196203
export(slather)
197204
export(smooth_quantile_reg)
205+
export(step_adjust_latency)
198206
export(step_epi_ahead)
199207
export(step_epi_lag)
200208
export(step_epi_naomit)
201209
export(step_epi_slide)
202210
export(step_growth_rate)
203211
export(step_lag_difference)
212+
export(step_panel_normalize)
204213
export(step_population_scaling)
205214
export(step_training_window)
206215
export(tibble)
@@ -211,6 +220,7 @@ export(update_model)
211220
export(validate_layer)
212221
export(weighted_interval_score)
213222
import(distributional)
223+
import(epidatasets)
214224
import(epiprocess)
215225
import(parsnip)
216226
import(recipes)
@@ -225,6 +235,7 @@ importFrom(checkmate,test_numeric)
225235
importFrom(checkmate,test_scalar)
226236
importFrom(cli,cli_abort)
227237
importFrom(cli,cli_warn)
238+
importFrom(dplyr,"%>%")
228239
importFrom(dplyr,across)
229240
importFrom(dplyr,all_of)
230241
importFrom(dplyr,any_of)
@@ -235,13 +246,20 @@ importFrom(dplyr,everything)
235246
importFrom(dplyr,filter)
236247
importFrom(dplyr,full_join)
237248
importFrom(dplyr,group_by)
249+
importFrom(dplyr,group_by_at)
250+
importFrom(dplyr,join_by)
238251
importFrom(dplyr,left_join)
239252
importFrom(dplyr,mutate)
253+
importFrom(dplyr,n)
254+
importFrom(dplyr,pull)
240255
importFrom(dplyr,relocate)
241256
importFrom(dplyr,rename)
257+
importFrom(dplyr,rowwise)
242258
importFrom(dplyr,select)
243259
importFrom(dplyr,summarise)
244260
importFrom(dplyr,summarize)
261+
importFrom(dplyr,tibble)
262+
importFrom(dplyr,tribble)
245263
importFrom(dplyr,ungroup)
246264
importFrom(epiprocess,epi_slide)
247265
importFrom(epiprocess,growth_rate)
@@ -255,18 +273,20 @@ importFrom(ggplot2,geom_line)
255273
importFrom(ggplot2,geom_linerange)
256274
importFrom(ggplot2,geom_point)
257275
importFrom(ggplot2,geom_ribbon)
276+
importFrom(glue,glue)
277+
importFrom(hardhat,extract_recipe)
258278
importFrom(hardhat,refresh_blueprint)
259279
importFrom(hardhat,run_mold)
260280
importFrom(magrittr,"%>%")
261281
importFrom(recipes,bake)
282+
importFrom(recipes,detect_step)
262283
importFrom(recipes,prep)
263284
importFrom(recipes,rand_id)
264285
importFrom(rlang,"!!!")
265286
importFrom(rlang,"!!")
266287
importFrom(rlang,"%@%")
267288
importFrom(rlang,"%||%")
268289
importFrom(rlang,":=")
269-
importFrom(rlang,abort)
270290
importFrom(rlang,arg_match)
271291
importFrom(rlang,as_function)
272292
importFrom(rlang,caller_arg)
@@ -276,16 +296,19 @@ importFrom(rlang,enquos)
276296
importFrom(rlang,expr)
277297
importFrom(rlang,global_env)
278298
importFrom(rlang,inject)
299+
importFrom(rlang,is_empty)
279300
importFrom(rlang,is_logical)
280301
importFrom(rlang,is_null)
281302
importFrom(rlang,is_true)
303+
importFrom(rlang,list2)
282304
importFrom(rlang,set_names)
283305
importFrom(rlang,sym)
284306
importFrom(stats,as.formula)
285307
importFrom(stats,family)
286308
importFrom(stats,lm)
287309
importFrom(stats,median)
288310
importFrom(stats,model.frame)
311+
importFrom(stats,na.omit)
289312
importFrom(stats,poly)
290313
importFrom(stats,predict)
291314
importFrom(stats,qnorm)
@@ -294,6 +317,12 @@ importFrom(stats,residuals)
294317
importFrom(tibble,as_tibble)
295318
importFrom(tibble,tibble)
296319
importFrom(tidyr,crossing)
320+
importFrom(tidyr,drop_na)
321+
importFrom(tidyr,expand_grid)
322+
importFrom(tidyr,fill)
323+
importFrom(tidyr,unnest)
324+
importFrom(tidyselect,all_of)
325+
importFrom(utils,capture.output)
297326
importFrom(vctrs,as_list_of)
298327
importFrom(vctrs,field)
299328
importFrom(vctrs,new_rcrd)
@@ -303,3 +332,4 @@ importFrom(vctrs,vec_data)
303332
importFrom(vctrs,vec_ptype_abbr)
304333
importFrom(vctrs,vec_ptype_full)
305334
importFrom(vctrs,vec_recycle_common)
335+
importFrom(workflows,extract_preprocessor)

NEWS.md

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

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

5+
# epipredict 0.2
6+
7+
## Breaking changes
8+
9+
- Moved example datasets from being hosted in the package to being loaded
10+
from the `epidatasets` package. The datasets can no longer be loaded with
11+
`data(<dataset name>)`, but can be accessed with
12+
`data(<dataset name>, package = "epidatasets")`, `epidatasets::<dataset name>`
13+
or, after loading the package, the name of the dataset alone (#382).
14+
15+
## Improvements
16+
17+
- Add `step_adjust_latency`, which give several methods to adjust the forecast if the `forecast_date` is after the last day of data.
18+
- (temporary) ahead negative is allowed for `step_epi_ahead` until we have `step_epi_shift`
19+
20+
## Bug fixes
21+
- Shifting no columns results in no error for either `step_epi_ahead` and `step_epi_lag`
22+
- Quantiles produced by `grf` were sometimes out of order.
23+
524
# epipredict 0.1
625

726
- simplify `layer_residual_quantiles()` to avoid timesuck in `utils::methods()`

0 commit comments

Comments
 (0)