Skip to content

Commit

Permalink
Merge pull request #410 from reichlab/bsweger/cleanup-unused-target-r…
Browse files Browse the repository at this point in the history
…eferences

Bsweger/cleanup unused target references
  • Loading branch information
bsweger committed Jan 29, 2024
2 parents 3ef41e9 + faa0e9d commit f7f5c57
Show file tree
Hide file tree
Showing 24 changed files with 125 additions and 916 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
@@ -1,3 +1,5 @@
^renv$
^renv\.lock$
^.*\.Rproj$
^\.Rproj\.user$
^\.github$
Expand Down
89 changes: 0 additions & 89 deletions .github/workflows/pr_unittest.yaml

This file was deleted.

51 changes: 28 additions & 23 deletions .github/workflows/r_cmd_check.yaml
@@ -1,36 +1,41 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]

name: R-CMD-check
on: pull_request

jobs:
R-CMD-check:
runs-on: macOS-latest

name: r-cmd-check

strategy:
fail-fast: false

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

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

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-pandoc@v2
- name: Cache R packages
uses: actions/cache@v1

- uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: r-${{ hashFiles('DESCRIPTION') }}
- name: Install dependencies
run: |
install.packages(c("devtools"))
devtools::install_github("epiforecasts/scoringutils@v1.2.2")
devtools::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Check
run: |
devtools::check(args = c("--no-tests", "--no-manual", "--no-vignettes"),error_on = "error")
shell: Rscript {0}
- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
error-on: '"error"'
upload-snapshots: true
14 changes: 14 additions & 0 deletions .gitignore
Expand Up @@ -10,3 +10,17 @@ inst/doc

# pre-commit isn't part of the team workflow, so don't commit the config
**/.pre-commit-config.yaml

docs
Meta

# data generated by test suite and other dev operations
tests/**/*.csv
tests/**/*.json
tests/**/*.rds

# renv artifacts (we're not using renv at the contributor level, so
# we'll exclude related files from the repo)
.Rprofile
renv.lock
renv/
4 changes: 2 additions & 2 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: covidHubUtils
Title: Utility functions for the COVID-19 forecast hub
Version: 0.1.8
Version: 0.1.9
Authors@R: c(
person(given = "Yijin Serena",
family = "Wang",
Expand Down Expand Up @@ -85,7 +85,7 @@ Imports:
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
VignetteBuilder: knitr
Suggests:
DT,
Expand Down
6 changes: 1 addition & 5 deletions NAMESPACE
Expand Up @@ -12,7 +12,6 @@ export(calc_target_end_date)
export(calc_target_week_end_date)
export(date_to_datetime)
export(download_raw_nytimes)
export(download_raw_usafacts)
export(get_all_models)
export(get_model_designations)
export(get_model_metadata)
Expand All @@ -35,15 +34,12 @@ export(plot_forecasts)
export(preprocess_hospitalization)
export(preprocess_jhu)
export(preprocess_nytimes)
export(preprocess_truth_for_zoltar)
export(preprocess_usafacts)
export(preprocess_visualization_truth)
export(reformat_forecasts)
export(save_truth_for_zoltar)
export(score_forecasts)
export(setup_zoltar_connection)
importFrom(doParallel,registerDoParallel)
importFrom(dplyr,`%>%`)
importFrom(dplyr,"%>%")
importFrom(dplyr,any_of)
importFrom(foreach,"%dopar%")
importFrom(foreach,foreach)
Expand Down
10 changes: 10 additions & 0 deletions NEWS.md
@@ -1,6 +1,16 @@
## Changes since last release
- None yet

## covidHubUtils 0.1.9

This update removes truth data functions that are no longer relevant.
### Updates
- Remove `download_raw_usafacts` and `preprocess_usafacts` because the last release
deprecated USAFacts as a truth source.
- Remove `preprocess_truth_for_zoltar` and `save_truth_for_zoltar`, as the truth
data being sent to Zoltar (JHU CSSE cases and deaths) stopped updating in March 2023.


## covidHubUtils 0.1.8

This update has minor changes.
Expand Down
6 changes: 3 additions & 3 deletions R/covidHubUtils-package.R
Expand Up @@ -2,7 +2,7 @@
#'
#' @author Evan L. Ray <elray@umass.edu>
#' @docType package
#' @importFrom dplyr `%>%`
#' @importFrom dplyr %>%
#' @name covidHubUtils
#' @aliases covidHubUtils covidHubUtils-package
#' @description Utility functions for the COVID-19 forecast hub
Expand All @@ -12,7 +12,7 @@ NULL
##' @name hub_locations
##' @title Information on locations in the COVID-19 Forecast Hub
##' @docType data
##' @format A data frame with information and metadata about national, state, and county locations for the US. 3,200 observations on the following 6 variables.
##' @format A data frame with information and metadata about national, state, and county locations for the US. 3,200 observations on the following 6 variables.
##' \describe{
##' \item{\code{fips}}{the FIPS code for each location}
##' \item{\code{location_name}}{A non-abbreviated name for each location}
Expand All @@ -24,4 +24,4 @@ NULL
##' @usage data(hub_locations)
##' @source JHU CSSE COVID Dashboard (https://github.com/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data), covidcast API (https://github.com/cmu-delphi/covidcast), COVID-19 Forecast Hub (https://covid19forecasthub.org/).
##' @keywords datasets
NULL
NULL
7 changes: 5 additions & 2 deletions R/get_plot_forecast_data.R
Expand Up @@ -22,7 +22,7 @@
#' Default to `TRUE`.
#' @param truth_source character specifying where the truth data will
#' be loaded from if truth_data is not provided. Currently support `"JHU"`,
#' `"USAFacts"`, `"NYTimes"` and `"HealthData"`.
#' `NYTimes"` and `"HealthData"`.
#' Optional if `truth_data` is provided.
#' @param target_variable_to_plot string specifying target type. It should be one of
#' `"cum death"`, `"inc case"`, `"inc death"`, `"inc hosp"` and `"inc flu hosp"`.
Expand Down Expand Up @@ -61,7 +61,7 @@ get_plot_forecast_data <- function(forecast_data,
"cum death", "inc case",
"inc death", "inc hosp"
)
valid_truth_sources <- c("JHU", "USAFacts", "NYTimes", "HealthData")
valid_truth_sources <- c("JHU", "NYTimes", "HealthData", "USAFacts")
} else if (hub[1] == "ECDC") {
valid_location_codes <- covidHubUtils::hub_locations_ecdc$location
valid_target_variables <- c("inc case", "inc death")
Expand Down Expand Up @@ -122,6 +122,9 @@ get_plot_forecast_data <- function(forecast_data,
}
} else {
# validate truth_source
if (tolower(truth_source) == "usafacts") {
stop("USAFacts can no longer be downloaded. Please use another truth source.")
}
truth_source <- match.arg(truth_source,
choices = valid_truth_sources,
several.ok = FALSE
Expand Down

0 comments on commit f7f5c57

Please sign in to comment.