Skip to content

Commit 7b730ea

Browse files
committed
Re-run flusight with backend scripts - (in the future just keep the vignette)
1 parent 3d8dd19 commit 7b730ea

15 files changed

Lines changed: 26784 additions & 26420 deletions

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

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: R-CMD-check.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
R-CMD-check:
14+
runs-on: ${{ matrix.config.os }}
15+
16+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
config:
21+
- {os: macos-latest, r: "release"}
22+
- {os: windows-latest, r: "release"}
23+
- {os: ubuntu-latest, r: "devel", http-user-agent: "release"}
24+
- {os: ubuntu-latest, r: "release"}
25+
- {os: ubuntu-latest, r: "oldrel-1"}
26+
27+
env:
28+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
29+
R_KEEP_PKG_SOURCE: yes
30+
31+
steps:
32+
- uses: actions/checkout@v6
33+
34+
- uses: r-lib/actions/setup-pandoc@v2
35+
36+
- uses: r-lib/actions/setup-r@v2
37+
with:
38+
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
use-public-rspm: true
41+
extra-repositories: https://mrc-ide.r-universe.dev
42+
43+
- uses: r-lib/actions/setup-r-dependencies@v2
44+
with:
45+
extra-packages: any::rcmdcheck
46+
needs: check
47+
48+
- uses: r-lib/actions/check-r-package@v2
49+
with:
50+
upload-snapshots: true
51+
build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf")'
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
name: test-coverage.yaml
9+
10+
permissions: read-all
11+
12+
jobs:
13+
test-coverage:
14+
runs-on: ubuntu-latest
15+
env:
16+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17+
18+
steps:
19+
- uses: actions/checkout@v6
20+
21+
- uses: r-lib/actions/setup-r@v2
22+
with:
23+
use-public-rspm: true
24+
extra-repositories: https://mrc-ide.r-universe.dev
25+
26+
- uses: r-lib/actions/setup-r-dependencies@v2
27+
with:
28+
extra-packages: any::covr, any::xml2
29+
needs: coverage
30+
31+
- name: Test coverage
32+
run: |
33+
cov <- covr::package_coverage(
34+
quiet = FALSE,
35+
clean = FALSE,
36+
install_path = file.path(
37+
normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"),
38+
"package"
39+
)
40+
)
41+
print(cov)
42+
covr::to_cobertura(cov)
43+
shell: Rscript {0}
44+
45+
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
46+
with:
47+
# Fail on upload errors outside PRs, or when a PR has a Codecov token.
48+
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
49+
files: ./cobertura.xml
50+
plugins: noop
51+
disable_search: true
52+
token: ${{ secrets.CODECOV_TOKEN }}
53+
54+
- name: Show testthat output
55+
if: always()
56+
run: |
57+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
58+
shell: bash
59+
60+
- name: Upload test results
61+
if: failure()
62+
uses: actions/upload-artifact@v7
63+
with:
64+
name: coverage-test-failures
65+
path: ${{ runner.temp }}/package

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ docs
1313
.Ruserdata
1414

1515
**/*.quarto_ipynb
16+
17+
# Resumable FluSight backtest cache
18+
data-raw/flusight-cache/

R/FluSight-data.R

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
#' Scores from the 2025--26 FluSight backtest
2525
#'
26-
#' Score summaries comparing `incast` with selected FluSight models. They let
27-
#' the FluSight vignette run without refitting models or downloading Hub data.
26+
#' Score summaries comparing `incast` with official FluSight team submissions.
27+
#' They let the vignette run without refitting models or downloading Hub data.
2828
#'
2929
#' `flusight_scores` contains scores pooled across locations.
3030
#' `flusight_scores_by_location` contains scores stratified by location.
@@ -40,8 +40,10 @@
4040
#' \item{wis_scaled_relative_skill}{Relative WIS scaled to the
4141
#' `FluSight-ensemble`; values below one are better.}
4242
#' \item{count}{Number of forecast tasks scored.}
43-
#' \item{model_group}{One of `"FluSight ensemble"`, `"FluSight model"`,
44-
#' or `"incast model"`.}
43+
#' \item{model_group}{One of `"FluSight ensemble"`, `"FluSight baseline"`,
44+
#' `"FluSight model"`, or `"incast model"`.}
45+
#' \item{display}{Whether the vignette's concise comparison displays the
46+
#' model. All models remain available for custom filtering.}
4547
#' }
4648
#'
4749
#' @source Forecasts and target data from the
@@ -63,9 +65,11 @@
6365
#' \item{wis_scaled_relative_skill}{Relative WIS scaled to the
6466
#' `FluSight-ensemble`; values below one are better.}
6567
#' \item{count}{Number of forecast tasks scored.}
66-
#' \item{model_group}{One of `"FluSight ensemble"`, `"FluSight model"`,
67-
#' or `"incast model"`.}
68+
#' \item{model_group}{One of `"FluSight ensemble"`, `"FluSight baseline"`,
69+
#' `"FluSight model"`, or `"incast model"`.}
6870
#' \item{state}{Two-letter state abbreviation.}
71+
#' \item{display}{Whether the vignette's concise comparison displays the
72+
#' model. All models remain available for custom filtering.}
6973
#' }
7074
#' @source Forecasts and target data from the
7175
#' \href{https://github.com/cdcepi/FluSight-forecast-hub/tree/v1.2.0}{

README.Rmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ set.seed(2026)
1818
# incast <a href="https://accidda.github.io/incast/"><img src="man/figures/logo.png" align="right" height="139" alt="incast website" /></a>
1919

2020
<!-- badges: start -->
21+
[![R-CMD-check](https://github.com/ACCIDDA/incast/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ACCIDDA/incast/actions/workflows/R-CMD-check.yaml)
22+
[![Codecov test coverage](https://codecov.io/gh/ACCIDDA/incast/graph/badge.svg)](https://app.codecov.io/gh/ACCIDDA/incast)
2123
<!-- badges: end -->
2224

2325
`incast` is an R package for infectious disease nowcasting and forecasting. It was developed through **[Insight Net](https://www.cdc.gov/insight-net)**, a **[CDC Center for Forecasting and Outbreak Analytics](https://www.cdc.gov/forecast-outbreak-analytics/index.html)** initiative.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# incast <a href="https://accidda.github.io/incast/"><img src="man/figures/logo.png" align="right" height="139" alt="incast website" /></a>
55

66
<!-- badges: start -->
7-
7+
[![R-CMD-check](https://github.com/ACCIDDA/incast/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ACCIDDA/incast/actions/workflows/R-CMD-check.yaml)
8+
[![Codecov test coverage](https://codecov.io/gh/ACCIDDA/incast/graph/badge.svg)](https://app.codecov.io/gh/ACCIDDA/incast)
89
<!-- badges: end -->
910

1011
`incast` is an R package for infectious disease nowcasting and

0 commit comments

Comments
 (0)