Skip to content

Commit ce40c50

Browse files
committed
Merge branch 'dev' into ml-99-panel-data-vignette
2 parents fd4798d + 2d1006e commit ce40c50

File tree

222 files changed

+10080
-4989
lines changed

Some content is hidden

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

222 files changed

+10080
-4989
lines changed

.Rbuildignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
^renv$
2+
^renv\.lock$
13
^epipredict\.Rproj$
24
^\.Rproj\.user$
35
^LICENSE\.md$
46
^drafts$
7+
^\.Rprofile$
58
^man-roxygen$
69
^README\.Rmd$
710
^\.github$
@@ -11,3 +14,6 @@
1114
^musings$
1215
^data-raw$
1316
^vignettes/articles$
17+
^.git-blame-ignore-revs$
18+
^doc$
19+
^Meta$

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# using styler at all
2+
aca7d5e7b66d8bac9d9fbcec3acdb98a087d58fa
3+
f12fcc2bf3fe0a75ba2b10eaaf8a1f1d22486a17

.github/pull_request_template.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
### Checklist
2+
3+
Please:
4+
5+
- [ ] Make sure this PR is against "dev", not "main".
6+
- [ ] Request a review from one of the current epipredict main reviewers:
7+
dajmcdon.
8+
- [ ] Makes sure to bump the version number in `DESCRIPTION` and `NEWS.md`.
9+
Always increment the patch version number (the third number), unless you are
10+
making a release PR from dev to main, in which case increment the minor
11+
version number (the second number).
12+
- [ ] Describe changes made in NEWS.md, making sure breaking changes
13+
(backwards-incompatible changes to the documented interface) are noted.
14+
Collect the changes under the next release number (e.g. if you are on
15+
0.7.2, then write your changes under the 0.8 heading).
16+
17+
### Change explanations for reviewer
18+
19+
### Magic GitHub syntax to mark associated Issue(s) as resolved when this is merged into the default branch
20+
21+
- Resolves #{issue number}

.github/workflows/R-CMD-check.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
#
4+
# Created with usethis + edited to use API key.
15
on:
26
push:
3-
branches: [main, frosting]
7+
branches: [main, dev]
48
pull_request:
5-
branches: [main, frosting]
9+
branches: [main, dev]
610

711
name: R-CMD-check
812

@@ -13,7 +17,7 @@ jobs:
1317
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1418
R_KEEP_PKG_SOURCE: yes
1519
steps:
16-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
1721

1822
- uses: r-lib/actions/setup-r@v2
1923
with:
@@ -25,3 +29,5 @@ jobs:
2529
needs: check
2630

2731
- uses: r-lib/actions/check-r-package@v2
32+
env:
33+
DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIPREDICT_GHACTIONS_DELPHI_EPIDATA_KEY }}

.github/workflows/pkgdown.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
#
4+
# Created with usethis + edited to run on PRs to dev, use API key.
35
on:
46
push:
5-
branches: [main, master]
7+
branches: [dev, main]
8+
pull_request:
9+
branches: [dev, main]
610
release:
711
types: [published]
812
workflow_dispatch:
@@ -11,14 +15,16 @@ name: pkgdown
1115

1216
jobs:
1317
pkgdown:
18+
# only build docs on the main repository and not forks
19+
if: github.repository_owner == 'cmu-delphi'
1420
runs-on: ubuntu-latest
1521
# Only restrict concurrency for non-PR jobs
1622
concurrency:
1723
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1824
env:
1925
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2026
steps:
21-
- uses: actions/checkout@v2
27+
- uses: actions/checkout@v3
2228

2329
- uses: r-lib/actions/setup-pandoc@v2
2430

@@ -32,12 +38,20 @@ jobs:
3238
needs: website
3339

3440
- name: Build site
35-
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
41+
env:
42+
DELPHI_EPIDATA_KEY: ${{ secrets.SECRET_EPIPROCESS_GHACTIONS_DELPHI_EPIDATA_KEY }}
43+
run: |
44+
if (startsWith("${{ github.event_name }}", "pull_request")) {
45+
mode <- ifelse("${{ github.base_ref }}" == "main", "release", "devel")
46+
} else {
47+
mode <- ifelse("${{ github.ref_name }}" == "main", "release", "devel")
48+
}
49+
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, override=list(PKGDOWN_DEV_MODE=mode))
3650
shell: Rscript {0}
3751

3852
- name: Deploy to GitHub pages 🚀
3953
if: github.event_name != 'pull_request'
40-
uses: JamesIves/[email protected].4
54+
uses: JamesIves/github-pages-deploy-action@v4.4.1
4155
with:
4256
clean: false
4357
branch: gh-pages

.github/workflows/styler.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
paths:
7+
[
8+
"**.[rR]",
9+
"**.[qrR]md",
10+
"**.[rR]markdown",
11+
"**.[rR]nw",
12+
"**.[rR]profile",
13+
]
14+
15+
name: Style
16+
17+
jobs:
18+
style:
19+
runs-on: ubuntu-latest
20+
env:
21+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
22+
steps:
23+
- name: Checkout repo
24+
uses: actions/checkout@v3
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Setup R
29+
uses: r-lib/actions/setup-r@v2
30+
with:
31+
use-public-rspm: true
32+
33+
- name: Install dependencies
34+
uses: r-lib/actions/setup-r-dependencies@v2
35+
with:
36+
extra-packages: any::styler, any::roxygen2
37+
needs: styler
38+
39+
- name: Enable styler cache
40+
run: styler::cache_activate()
41+
shell: Rscript {0}
42+
43+
- name: Determine cache location
44+
id: styler-location
45+
run: |
46+
cat(
47+
"location=",
48+
styler::cache_info(format = "tabular")$location,
49+
"\n",
50+
file = Sys.getenv("GITHUB_OUTPUT"),
51+
append = TRUE,
52+
sep = ""
53+
)
54+
shell: Rscript {0}
55+
56+
- name: Cache styler
57+
uses: actions/cache@v3
58+
with:
59+
path: ${{ steps.styler-location.outputs.location }}
60+
key: ${{ runner.os }}-styler-${{ github.sha }}
61+
restore-keys: |
62+
${{ runner.os }}-styler-
63+
${{ runner.os }}-
64+
65+
- name: Style
66+
run: styler::style_pkg()
67+
shell: Rscript {0}
68+
69+
- name: Commit and push changes
70+
run: |
71+
if FILES_TO_COMMIT=($(git diff-index --name-only ${{ github.sha }} \
72+
| egrep --ignore-case '\.(R|[qR]md|Rmarkdown|Rnw|Rprofile)$'))
73+
then
74+
git config --local user.name "$GITHUB_ACTOR"
75+
git config --local user.email "[email protected]"
76+
git commit ${FILES_TO_COMMIT[*]} -m "Style code (GHA)"
77+
git pull --ff-only
78+
git push origin
79+
else
80+
echo "No changes to commit."
81+
fi

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
docs
66
inst/doc
77
.DS_Store
8+
/doc/
9+
/Meta/
10+
.Rprofile
11+
renv.lock
12+
renv/

DESCRIPTION

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
Package: epipredict
22
Title: Basic epidemiology forecasting methods
3-
Version: 0.0.3
3+
Version: 0.0.9
44
Authors@R: c(
55
person("Daniel", "McDonald", , "[email protected]", role = c("aut", "cre")),
66
person("Ryan", "Tibshirani", , "[email protected]", role = "aut"),
77
person("Logan", "Brooks", role = "aut"),
88
person("Rachel", "Lobay", role = "aut"),
9-
person("Maggie", "Liu", role = "aut"),
10-
person("Ken", "Mawer", role = "aut"),
11-
person("Chloe", "You", role = "aut"),
9+
person("Dmitry", "Shemetov", email = "[email protected]", role = "ctb"),
10+
person("David", "Weber", email = "[email protected]", role = "ctb"),
11+
person("Maggie", "Liu", role = "ctb"),
12+
person("Ken", "Mawer", role = "ctb"),
13+
person("Chloe", "You", role = "ctb"),
1214
person("Jacob", "Bien", role = "ctb")
1315
)
1416
Description: A forecasting "framework" for creating epidemiological
@@ -20,35 +22,37 @@ License: MIT + file LICENSE
2022
URL: https://github.com/cmu-delphi/epipredict/,
2123
https://cmu-delphi.github.io/epipredict
2224
BugReports: https://github.com/cmu-delphi/epipredict/issues/
23-
Depends:
24-
epiprocess,
25+
Depends:
26+
epiprocess (>= 0.6.0),
2527
parsnip (>= 1.0.0),
2628
R (>= 3.5.0)
27-
Imports:
29+
Imports:
30+
checkmate,
2831
cli,
2932
distributional,
3033
dplyr,
3134
fs,
3235
generics,
3336
glue,
34-
hardhat (>= 1.2.0),
37+
hardhat (>= 1.3.0),
38+
lifecycle,
3539
magrittr,
3640
methods,
3741
quantreg,
38-
recipes (>= 1.0.0),
42+
recipes (>= 1.0.4),
3943
rlang,
44+
smoothqr,
4045
stats,
41-
tensr,
4246
tibble,
4347
tidyr,
4448
tidyselect,
4549
usethis,
4650
vctrs,
4751
workflows (>= 1.0.0)
48-
Suggests:
52+
Suggests:
4953
covidcast,
5054
data.table,
51-
epidatr,
55+
epidatr (>= 1.0.0),
5256
ggplot2,
5357
knitr,
5458
lubridate,
@@ -58,13 +62,14 @@ Suggests:
5862
rmarkdown,
5963
testthat (>= 3.0.0),
6064
xgboost
61-
VignetteBuilder:
65+
VignetteBuilder:
6266
knitr
6367
Remotes:
6468
cmu-delphi/epidatr,
65-
cmu-delphi/epiprocess
69+
cmu-delphi/epiprocess,
70+
dajmcdon/smoothqr
6671
Config/testthat/edition: 3
6772
Encoding: UTF-8
6873
LazyData: true
6974
Roxygen: list(markdown = TRUE)
70-
RoxygenNote: 7.2.3
75+
RoxygenNote: 7.3.0

DEVELOPMENT.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
## Setting up the development environment
2+
3+
```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
8+
```
9+
10+
## Validating the package
11+
12+
```r
13+
styler::style_pkg() # format code
14+
lintr::lint_package() # lint code
15+
16+
devtools::test() # test package
17+
devtools::check() # check package for errors
18+
```
19+
20+
## Developing the documentation site
21+
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+
```
29+
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`.
31+
32+
You can also build the docs manually and launch the site with python. From the terminal, this looks like
33+
```bash
34+
R -e 'devtools::document()'
35+
python -m http.server -d docs
36+
```
37+
38+
## Versioning
39+
40+
Please follow the guidelines in the PR template document (reproduced here):
41+
42+
- [ ] Make sure this PR is against "dev", not "main".
43+
- [ ] Request a review from one of the current epipredict main reviewers:
44+
dajmcdon.
45+
- [ ] Makes sure to bump the version number in `DESCRIPTION` and `NEWS.md`.
46+
Always increment the patch version number (the third number), unless you are
47+
making a release PR from dev to main, in which case increment the minor
48+
version number (the second number).
49+
- [ ] Describe changes made in NEWS.md, making sure breaking changes
50+
(backwards-incompatible changes to the documented interface) are noted.
51+
Collect the changes under the next release number (e.g. if you are on
52+
0.7.2, then write your changes under the 0.8 heading).
53+
54+
## Release process
55+
56+
TBD

0 commit comments

Comments
 (0)