Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ VignetteBuilder: knitr
Depends:
R (>= 3.5)
LazyData: true
URL: https://github.com/ACCIDDA/accidasuite, https://ACCIDDA.github.io/accidasuite/, https://accidda.github.io/acciddasuite/
URL: https://github.com/ACCIDDA/acciddasuite, https://ACCIDDA.github.io/acciddasuite/, https://accidda.github.io/acciddasuite/
Config/testthat/edition: 3
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ S3method(fitted,model_epiestim)
S3method(forecast,model_epiestim)
S3method(glance,model_epiestim)
S3method(model_sum,model_epiestim)
S3method(print,accida_cast)
S3method(print,accidda_cast)
S3method(report,model_epiestim)
S3method(residuals,model_epiestim)
S3method(tidy,model_epiestim)
Expand Down
4 changes: 2 additions & 2 deletions R/get_fcast.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#'
#' The name of each list element is used as the model label in the output.
#'
#' @return An object of class `accida_cast` containing:
#' @return An object of class `accidda_cast` containing:
#' \describe{
#' \item{forecast}{Final `h` week ahead forecasts for all models and the ensemble.}
#' \item{score}{Model ranking based on rolling origin WIS.}
Expand Down Expand Up @@ -243,6 +243,6 @@ get_fcast <- function(
score = score,
plot = plot
)
class(acast) <- "accida_cast"
class(acast) <- "accidda_cast"
return(acast)
}
10 changes: 5 additions & 5 deletions R/print.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#' Print an accida_cast object
#' Print an accidda_cast object
#'
#' Displays a concise summary of an \code{accida_cast} object,
#' Displays a concise summary of an \code{accidda_cast} object,
#' including model scores, forecast horizon, and hub format contents.
#'
#' @param x An object of class \code{accida_cast}.
#' @param x An object of class \code{accidda_cast}.
#' @param ... Additional arguments (currently ignored).
#' @export
print.accida_cast <- function(x, ...) {
cat("<accida_cast>\n\n")
print.accidda_cast <- function(x, ...) {
cat("<accidda_cast>\n\n")

cat("Models evaluated:\n")
print(x$score |> dplyr::select(model_id, wis), row.names = FALSE)
Expand Down
16 changes: 8 additions & 8 deletions R/to_respilens.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,21 @@ forecasts_key <- function(model_out_tbl) {
}


#' Convert accida_cast to RespiLens format
#' @param accida_cast An object of class `accida_cast`, the output of `get_fcast()`.
#' Convert accidda_cast to RespiLens format
#' @param accidda_cast An object of class `accidda_cast`, the output of `get_fcast()`.
#' @param path Optional file path to write the JSON output to. Must end with `.json`.
#' If `NULL`, the output is not written to disk.
#' @return A named list with a single metadata JSON structure and one JSON structure per location.
#' @export

to_respilens <- function(accida_cast, path = NULL) {
#check it is of class `accida_cast`
if (!inherits(accida_cast, "accida_cast")) {
stop("Input must be an object of class 'accida_cast'.")
to_respilens <- function(accidda_cast, path = NULL) {
#check it is of class `accidda_cast`
if (!inherits(accidda_cast, "accidda_cast")) {
stop("Input must be an object of class 'accidda_cast'.")
}

model_out_tbl = accida_cast$hubcast$model_out_tbl
oracle_output = accida_cast$hubcast$oracle_output
model_out_tbl = accidda_cast$hubcast$model_out_tbl
oracle_output = accidda_cast$hubcast$oracle_output

# Necessary model_out_tbl filtering
# PATCH: removing 'peaks' keys for now (MyRespiLens doesn't support yet)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ df <- get_data(pathogen = "flu", geo_values = "ny")
fcast <- df |>
get_fcast(eval_start_date = max(df$target_end_date) - 30)
fcast
#> <accida_cast>
#> <accidda_cast>
#>
#> Models evaluated:
#> model_id wis
Expand Down
6 changes: 3 additions & 3 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ template:
height: 250px
repo:
url:
home: https://github.com/ACCIDDA/accidasuite
issue: https://github.com/ACCIDDA/accidasuite/issues
home: https://github.com/ACCIDDA/acciddasuite
issue: https://github.com/ACCIDDA/acciddasuite/issues
user: https://github.com/ACCIDDA
source: https://github.com/ACCIDDA/accidasuite/blob/main/
source: https://github.com/ACCIDDA/acciddasuite/blob/main/
1 change: 0 additions & 1 deletion docs/.nojekyll

This file was deleted.

2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions docs/articles/acciddasuite.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions docs/articles/acciddasuite.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ head(df)
#> # A tibble: 6 × 5
#> as_of location target target_end_date observation
#> <date> <chr> <chr> <date> <dbl>
#> 1 2026-03-01 NY wk inc covid hosp 2020-08-08 517
#> 2 2026-03-01 NY wk inc covid hosp 2020-08-15 490
#> 3 2026-03-01 NY wk inc covid hosp 2020-08-22 844
#> 4 2026-03-01 NY wk inc covid hosp 2020-08-29 483
#> 5 2026-03-01 NY wk inc covid hosp 2020-09-05 479
#> 6 2026-03-01 NY wk inc covid hosp 2020-09-12 573
#> 1 2026-03-08 NY wk inc covid hosp 2020-08-08 517
#> 2 2026-03-08 NY wk inc covid hosp 2020-08-15 490
#> 3 2026-03-08 NY wk inc covid hosp 2020-08-22 844
#> 4 2026-03-08 NY wk inc covid hosp 2020-08-29 483
#> 5 2026-03-08 NY wk inc covid hosp 2020-09-05 479
#> 6 2026-03-08 NY wk inc covid hosp 2020-09-12 573
```

To look at what `df` looks like, you can access the example `csv` file
Expand Down Expand Up @@ -81,20 +81,20 @@ fcast = get_fcast(
time_pipe("base fcast", log = "timing")

fcast
#> <accida_cast>
#> <accidda_cast>
#>
#> Models evaluated:
#> model_id wis
#> <char> <num>
#> THETA 27.20068
#> ARIMA 35.22355
#> ETS 41.93945
#> ENSEMBLE 53.91791
#> SNAIVE 262.42959
#> THETA 26.88197
#> ARIMA 29.14217
#> ETS 31.33395
#> ENSEMBLE 52.64632
#> SNAIVE 256.25401
#>
#> Forecast horizon:
#> From: 2026-01-31
#> To: 2026-03-28
#> From: 2026-02-07
#> To: 2026-04-04
#>
#> Contents:
#> $hubcast hub forecast object
Expand Down Expand Up @@ -145,9 +145,9 @@ You can check how long each step took by calling
``` r
get_log()
#> $timing
#> timestamp label duration unit
#> 1 2026-03-10 15:10:11 base fcast 3.002838 secs
#> 2 2026-03-10 15:10:14 extra fcast 18.625748 secs
#> timestamp label duration unit
#> 1 2026-03-18 14:24:26 base fcast 2.417592 secs
#> 2 2026-03-18 14:24:29 extra fcast 2.867576 secs
```

## Submit to MyRespiLens
Expand Down
Binary file modified docs/articles/acciddasuite_files/figure-html/models-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions docs/authors.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
## Citation

Source:
[`DESCRIPTION`](https://github.com/ACCIDDA/accidasuite/blob/main/DESCRIPTION)
[`DESCRIPTION`](https://github.com/ACCIDDA/acciddasuite/blob/main/DESCRIPTION)

Last F (2026). *acciddasuite: A suite of tools for epidemic
forecasting*. R package version 0.0.0.9000,
<https://github.com/ACCIDDA/accidasuite>.
<https://github.com/ACCIDDA/acciddasuite>.

@Manual{,
title = {acciddasuite: A suite of tools for epidemic forecasting},
author = {First Last},
year = {2026},
note = {R package version 0.0.0.9000},
url = {https://github.com/ACCIDDA/accidasuite},
url = {https://github.com/ACCIDDA/acciddasuite},
}
Loading
Loading