Skip to content

Commit

Permalink
Don't install scoringutils in the vignette
Browse files Browse the repository at this point in the history
The vignette should use the scoringutils package made available
via covidHubUtils, rather than trying to install it again (which
can cause an "unload" error).

First pass at removing some the explicit dependency install in the R CHECK workflow

Also removed tidyverse dependency in align.R as part of this cleanup.

Remove RSocrata install

I don't *think* we're downloading anything from Socrata in this package

remove here and textshaping installs from the github workflows

Remove the extraneous "remotes" install in the github workflows

We still have #406 to get the covidHubUtils workflows in better alignment
with those in the hubverse, but for now we're focused on cleaning up workflow installs
per # 404 by either moving them to DESCRIPTION (if they're used) or
deleting them (if they're not).

Fixup to reinstate the specific version for scoringutils

Move covidData to a first-class dependency (rather than 'suggests')

Removing some of the explicit dependency installs from github
workflows broke things, because covidData wasn't being installed
with the command install_deps(NA). Since covidData is used by
covidHubUtils, let's make sure it's always installed and try to
avoid ad-hoc package installation in CI.

Fix vignette errors by making sure the packages in "suggests" are
installed

Remove explicit installs of zoltr and covidData

Let's see what happens when we remove the build steps that install
zoltr and covidData (since these two packages are already listed
as dependencies in covidHubUtils)

fixup PR feedback

Try making sure the package itself is installed

Streamline dependency installs in pkgdown.yaml
  • Loading branch information
bsweger committed Jan 22, 2024
1 parent 7dabdf2 commit 878367f
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 40 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ jobs:

- name: Install dependencies
run: |
install.packages(c("remotes","devtools", "rmarkdown","tidyverse","DT","here", "pkgdown", "textshaping"))
devtools::install_github("epiforecasts/scoringutils")
remotes::install_deps(dependencies = NA)
shell: Rscript {0}

- name: Install zoltr
run: |
devtools::install_github("reichlab/zoltr")
install.packages(c("devtools"))
remotes::install_deps(dependencies = TRUE)
devtools::install()
shell: Rscript {0}

Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/pr_unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@ jobs:
key: r-${{ hashFiles('DESCRIPTION') }}
- name: Install dependencies
run: |
install.packages(c("remotes","devtools", "rmarkdown","tidyverse","DT","here","RSocrata"))
devtools::install_github("epiforecasts/[email protected]")
remotes::install_deps(dependencies = NA)
shell: Rscript {0}
- name: Install zoltr
run: |
devtools::install_github("reichlab/zoltr")
install.packages(c("devtools"))
remotes::install_deps(dependencies = TRUE)
devtools::install()
shell: Rscript {0}
- name: Run unit tests
Expand Down Expand Up @@ -85,7 +80,7 @@ jobs:
shell: Rscript {0}
- name: Render vignettes
run: |
rmarkdown::render("vignettes/covidHubUtils-overview.Rmd")
devtools::build_vignettes()
shell: Rscript {0}


Expand Down
17 changes: 2 additions & 15 deletions .github/workflows/r_cmd_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,10 @@ jobs:
key: r-${{ hashFiles('DESCRIPTION') }}
- name: Install dependencies
run: |
install.packages(c("remotes","devtools","rmarkdown","tidyverse","DT","here","RSocrata"))
install.packages(c("devtools"))
devtools::install_github("epiforecasts/[email protected]")
remotes::install_deps(dependencies = NA)
devtools::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Install zoltr
run: |
devtools::install_github("reichlab/zoltr")
devtools::install()
shell: Rscript {0}
- name: Checkout covidData
uses: actions/checkout@v3
with:
repository: reichlab/covidData
path: covidData
- name: Install covidData
run: make recent_data
working-directory: ./covidData/code/data-processing
- name: Check
run: |
devtools::check(args = c("--no-tests", "--no-manual", "--no-vignettes"),error_on = "error")
Expand Down
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Description:
https://covid19forecasthub.org/.
License: MIT
Imports:
covidData,
dplyr (>= 0.8.4),
tibble (>= 2.1.3),
tidyr (>= 1.0.2),
Expand Down Expand Up @@ -86,12 +87,13 @@ LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
VignetteBuilder: knitr
Suggests:
testthat,
covidData,
Suggests:
DT,
knitr,
rmarkdown
mockery,
testthat
Remotes:
reichlab/covidData,
reichlab/zoltr,
epiforecasts/[email protected]
Depends:
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-align.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
library(tidyverse)
library(covidHubUtils)
library(testthat)
library(tibble)
library(tidyr)


# Aug/Sep 2021
Expand Down Expand Up @@ -51,7 +52,7 @@ test_that("original columns preserved and new columns are correct", {
)
)
reference_dates <- as.Date(c(
"2021-08-14",
"2021-08-14",
"2021-08-14",
"2021-08-16",
"2021-08-21",
Expand Down
5 changes: 2 additions & 3 deletions vignettes/covidHubUtils-overview.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ We have identified two central use cases for downloading data using `load_foreca

2. Downloading all available forecasts for selected models that are submitted on a set of dates. This is achieved by using a vector of dates in `dates` parameter.

Below are some examples of reading in data. We start by loading the `covidHubUtils` package and the `tidyverse`.
Below are some examples of reading in data. We start by loading the `covidHubUtils` package.

```{r message=FALSE}
library(covidHubUtils)
library(doParallel)
library(tidyverse)
library(ggplot2)
theme_set(theme_bw())
```

Expand Down Expand Up @@ -433,7 +433,6 @@ The inputs to the `scored_forecasts()` include a `forecasts` data frame created

The `scoringutils` package provides a collection of metrics and proper scoring rules that make it simple to score forecasts against the true observed values.
``` {r}
# devtools::install_github("epiforecasts/[email protected]")
library(scoringutils)
```

Expand Down

0 comments on commit 878367f

Please sign in to comment.