Skip to content

Commit e9f5924

Browse files
authored
Merge pull request #416 from cmu-delphi/ds/vignettes
doc: update sliding vignette
2 parents 2126db5 + ac145f3 commit e9f5924

File tree

11 files changed

+708
-671
lines changed

11 files changed

+708
-671
lines changed

DEVELOPMENT.md

Lines changed: 52 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,35 +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
3533
R -e 'pkgdown::clean_site()'
3634
R -e 'devtools::document()'
3735
R -e 'pkgdown::build_site()'
38-
python -m http.server -d docs
3936
```
4037

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+
4143
## Versioning
4244

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

45-
## 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...
4677

47-
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.

_pkgdown.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ navbar:
2222
type: light
2323

2424
articles:
25-
- title: Get started
26-
navbar: ~
27-
contents:
28-
- epipredict
29-
- preprocessing-and-models
30-
- arx-classifier
31-
- update
25+
- title: Get started
26+
navbar: ~
27+
contents:
28+
- epipredict
29+
- preprocessing-and-models
30+
- backtesting
31+
- arx-classifier
32+
- update
3233

33-
- title: Advanced methods
34-
contents:
35-
- articles/sliding
36-
- articles/smooth-qr
37-
- articles/symptom-surveys
38-
- panel-data
34+
- title: Advanced methods
35+
contents:
36+
- articles/smooth-qr
37+
- articles/symptom-surveys
38+
- panel-data
3939

4040
repo:
4141
url:
@@ -79,15 +79,15 @@ reference:
7979
- grf_quantiles
8080
- title: Custom panel data forecasting workflows
8181
contents:
82-
- epi_recipe
83-
- epi_workflow
84-
- add_epi_recipe
85-
- adjust_epi_recipe
86-
- Add_model
87-
- predict.epi_workflow
88-
- fit.epi_workflow
89-
- augment.epi_workflow
90-
- forecast.epi_workflow
82+
- epi_recipe
83+
- epi_workflow
84+
- add_epi_recipe
85+
- adjust_epi_recipe
86+
- Add_model
87+
- predict.epi_workflow
88+
- fit.epi_workflow
89+
- augment.epi_workflow
90+
- forecast.epi_workflow
9191

9292
- title: Epi recipe preprocessing steps
9393
contents:

vignettes/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.html
22
*_cache/
33
*.R
4+
!_common.R

vignettes/_common.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
knitr::opts_chunk$set(
2+
digits = 3,
3+
comment = "#>",
4+
collapse = TRUE,
5+
cache = TRUE,
6+
dev.args = list(bg = "transparent"),
7+
dpi = 300,
8+
cache.lazy = FALSE,
9+
out.width = "90%",
10+
fig.align = "center",
11+
fig.width = 9,
12+
fig.height = 6
13+
)
14+
ggplot2::theme_set(ggplot2::theme_bw())
15+
options(
16+
dplyr.print_min = 6,
17+
dplyr.print_max = 6,
18+
pillar.max_footer_lines = 2,
19+
pillar.min_chars = 15,
20+
stringr.view_n = 6,
21+
pillar.bold = TRUE,
22+
width = 77
23+
)

0 commit comments

Comments
 (0)