Skip to content

Commit

Permalink
Merge pull request #427 from cmu-delphi/main-to-dev
Browse files Browse the repository at this point in the history
Main to dev
  • Loading branch information
dajmcdon authored Nov 12, 2024
2 parents 9d70989 + 375a2ed commit f8b7945
Show file tree
Hide file tree
Showing 12 changed files with 103 additions and 101 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,12 @@ jobs:
needs: website

- name: Build site
# - target_ref gets the ref from a different variable, depending on the event
# - override allows us to set the pkgdown mode and version_label
# - mode: release is the standard build mode, devel places the site in /dev
# - version_label: 'light' and 'success' are CSS labels for Bootswatch: Cosmo
# https://bootswatch.com/cosmo/
# - we use pkgdown:::build_github_pages to build the site because of an issue in pkgdown
# https://github.com/r-lib/pkgdown/issues/2257
run: |
target_ref <- "${{ github.event_name == 'pull_request' && github.base_ref || github.ref }}"
override <- if (target_ref == "main" || target_ref == "refs/heads/main") {
list(development = list(mode = "release", version_label = "light"))
} else if (target_ref == "dev" || target_ref == "refs/heads/dev") {
list(development = list(mode = "devel", version_label = "success"))
} else {
stop("Unexpected target_ref: ", target_ref)
}
pkg <- pkgdown::as_pkgdown(".", override = override)
cli::cli_rule("Cleaning files from old site...")
pkgdown::clean_site(pkg)
pkgdown::build_site(pkg, preview = FALSE, install = FALSE, new_process = FALSE)
pkgdown:::build_github_pages(pkg)
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/styler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ inst/doc
/Meta/
.Rprofile
renv.lock
renv/
renv/
12 changes: 7 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Package: epipredict
Title: Basic epidemiology forecasting methods
Version: 0.1.4
Version: 0.1.5
Authors@R: c(
person("Daniel J.", "McDonald", , "[email protected]", role = c("aut", "cre")),
person("Ryan", "Tibshirani", , "[email protected]", role = "aut"),
person("Dmitry", "Shemetov", email = "[email protected]", role = "aut"),
person("David", "Weber", email = "[email protected]", role = "aut"),
person("CMU's Delphi Research Group", role = c("cph", "fnd")),
person("Dmitry", "Shemetov", , "[email protected]", role = "aut"),
person("David", "Weber", , "[email protected]", role = "aut"),
person("Delphi Research Group", role = c("cph", "fnd")),
person("Logan", "Brooks", role = "aut"),
person("Rachel", "Lobay", role = "aut"),
person("Maggie", "Liu", role = "ctb"),
Expand All @@ -24,8 +24,8 @@ URL: https://github.com/cmu-delphi/epipredict/,
https://cmu-delphi.github.io/epipredict
BugReports: https://github.com/cmu-delphi/epipredict/issues/
Depends:
epiprocess (>= 0.9.0),
epidatasets,
epiprocess (>= 0.9.0),
parsnip (>= 1.0.0),
R (>= 3.5.0)
Imports:
Expand Down Expand Up @@ -69,11 +69,13 @@ Suggests:
VignetteBuilder:
knitr
Remotes:
cmu-delphi/delphidocs,
cmu-delphi/epidatasets,
cmu-delphi/epidatr,
cmu-delphi/epiprocess,
cmu-delphi/epidatasets,
dajmcdon/smoothqr
Config/Needs/website: cmu-delphi/delphidocs
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Expand Down
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,24 @@ You can view documentation for the `main` branch at
You should be able to do a reasonably limited amount of
customization on them. For the basic forecasters, we currently
provide:
- Baseline flatline forecaster
- Autoregressive forecaster
- Autoregressive classifier
- CDC FluSight flatline forecaster
- Baseline flatline forecaster
- Autoregressive forecaster
- Autoregressive classifier
- CDC FluSight flatline forecaster
2. A framework for creating custom forecasters out of modular
components. There are four types of components:
- Preprocessor: do things to the data before model training
- Trainer: train a model on data, resulting in a fitted model
object
- Predictor: make predictions, using a fitted model object
- Postprocessor: do things to the predictions before returning
- Preprocessor: do things to the data before model training
- Trainer: train a model on data, resulting in a fitted model object
- Predictor: make predictions, using a fitted model object
- Postprocessor: do things to the predictions before returning

**Target audiences:**

- Basic. Has data, calls forecaster with default arguments.
- Intermediate. Wants to examine changes to the arguments, take
advantage of built in flexibility.
- Advanced. Wants to write their own forecasters. Maybe willing to
build up from some components.
- Basic. Has data, calls forecaster with default arguments.
- Intermediate. Wants to examine changes to the arguments, take
advantage of built in flexibility.
- Advanced. Wants to write their own forecasters. Maybe willing to build
up from some components.

The Advanced user should find their task to be relatively easy. Examples
of these tasks are illustrated in the [vignettes and
Expand All @@ -71,7 +70,7 @@ The package comes with some built-in historical data for illustration,
but up-to-date versions of this could be downloaded with the
[`{epidatr}` package](https://cmu-delphi.github.io/epidatr/) and
processed using
[`{epiprocess}`](https://cmu-delphi.github.io/epiprocess/).\[1\]
[`{epiprocess}`](https://cmu-delphi.github.io/epiprocess/).[^1]

``` r
library(epipredict)
Expand Down Expand Up @@ -114,7 +113,7 @@ two_week_ahead <- arx_forecaster(
two_week_ahead
#> ══ A basic forecaster of type ARX Forecaster ═══════════════════════════════
#>
#> This forecaster was fit on 2024-01-29 15:10:01.
#> This forecaster was fit on 2024-11-11 11:38:31.
#>
#> Training data was an <epi_df> with:
#> • Geography: state,
Expand Down Expand Up @@ -207,7 +206,7 @@ through the end of 2021 for the 14th of January 2022. A prediction for
the death rate per 100K inhabitants is available for every state
(`geo_value`) along with a 90% predictive interval.

1. Other epidemiological signals for non-Covid related illnesses are
[^1]: Other epidemiological signals for non-Covid related illnesses are
also available with
[`{epidatr}`](https://github.com/cmu-delphi/epidatr) which
interfaces directly to Delphi’s [Epidata
Expand Down
56 changes: 25 additions & 31 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
url: https://cmu-delphi.github.io/epipredict/

# This is to give a default value to the `mode` parameter in the
# `pkgdown::build_site()` function. This is useful when building the site locally,
# as it will default to `devel` mode. In practice, this should all be handled
# dynamically by the CI/CD pipeline.
development:
mode: devel
version_label: success
mode: auto

template:
bootstrap: 5
bootswatch: cosmo
bslib:
font_scale: 1.0
primary: "#C41230"
success: "#B4D43C"
link-color: "#C41230"

navbar:
bg: primary
type: light
package: delphidocs

articles:
- title: Get started
Expand All @@ -30,39 +15,40 @@ articles:
- backtesting
- arx-classifier
- update

- title: Advanced methods
contents:
- articles/sliding
- articles/smooth-qr
- articles/symptom-surveys
- panel-data

repo:
url:
home: https://github.com/cmu-delphi/epipredict/tree/main/
source: https://github.com/cmu-delphi/epipredict/blob/main/
home: https://github.com/cmu-delphi/epipredict/
source: https://github.com/cmu-delphi/epipredict/
issue: https://github.com/cmu-delphi/epipredict/issues
user: https://github.com/

home:
links:
- text: Introduction to Delphi's Tooling Work
href: https://cmu-delphi.github.io/delphi-tooling-book/
- text: The epiprocess R package
- text: The epiprocess package
href: https://cmu-delphi.github.io/epiprocess/
- text: The epidatr R package
href: https://github.com/cmu-delphi/epidatr/
- text: The epidatasets R package
href: https://cmu-delphi.github.io/epidatasets/
- text: The covidcast R package
href: https://cmu-delphi.github.io/covidcast/covidcastR/
sidebar:
structure: [links, license, community, citation, authors, dev, related]
components:
related:
title: Delphi packages and resources
text: |
* [The epidatr package](https://github.com/cmu-delphi/epidatr/)
* [The epiprocess package](https://cmu-delphi.github.io/epiprocess/)
* [The epidatasets package](https://cmu-delphi.github.io/epidatasets/)
* [Introduction to Delphi's Tooling Work](https://cmu-delphi.github.io/delphi-tooling-book/)
reference:
- title: Simple forecasters
desc: Complete forecasters that produce reasonable baselines
contents:
- contains("forecaster")
- contains("classifier")

- title: Forecaster modifications
desc: Constructors to modify forecaster arguments and utilities to produce `epi_workflow` objects
contents:
Expand All @@ -71,12 +57,14 @@ reference:
- title: Helper functions for Hub submission
contents:
- flusight_hub_formatter

- title: Parsnip engines
desc: Prediction methods not available elsewhere
contents:
- quantile_reg
- smooth_quantile_reg
- grf_quantiles

- title: Custom panel data forecasting workflows
contents:
- epi_recipe
Expand All @@ -93,31 +81,37 @@ reference:
contents:
- starts_with("step_")
- contains("bake")

- title: Epi recipe verification checks
contents:
- check_enough_train_data

- title: Forecast postprocessing
desc: Create a series of postprocessing operations
contents:
- frosting
- ends_with("_frosting")
- get_test_data
- tidy.frosting

- title: Frosting layers
contents:
- contains("layer")
- contains("slather")

- title: Automatic forecast visualization
contents:
- autoplot.epi_workflow
- autoplot.canned_epipred

- title: Utilities for quantile distribution processing
contents:
- dist_quantiles
- extrapolate_quantiles
- nested_quantiles
- weighted_interval_score
- starts_with("pivot_quantiles")

- title: Other utilities
contents:
- clean_f_name
File renamed without changes.
Loading

0 comments on commit f8b7945

Please sign in to comment.