From c9e9ca8c273fbba6ee7febfc600c6c183a74fd01 Mon Sep 17 00:00:00 2001 From: Richard Martin-Nielsen Date: Mon, 27 Sep 2021 20:15:59 +0300 Subject: [PATCH 01/18] Add tests for json_reader function and sample json data --- tests/testthat/custom_data/mtcars.json | 1 + tests/testthat/test-json_reader.R | 36 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/testthat/custom_data/mtcars.json create mode 100644 tests/testthat/test-json_reader.R diff --git a/tests/testthat/custom_data/mtcars.json b/tests/testthat/custom_data/mtcars.json new file mode 100644 index 00000000..bd79a009 --- /dev/null +++ b/tests/testthat/custom_data/mtcars.json @@ -0,0 +1 @@ +[{"mpg":21,"cyl":6,"disp":160,"hp":110,"drat":3.9,"wt":2.62,"qsec":16.46,"vs":0,"am":1,"gear":4,"carb":4},{"mpg":21,"cyl":6,"disp":160,"hp":110,"drat":3.9,"wt":2.875,"qsec":17.02,"vs":0,"am":1,"gear":4,"carb":4},{"mpg":22.8,"cyl":4,"disp":108,"hp":93,"drat":3.85,"wt":2.32,"qsec":18.61,"vs":1,"am":1,"gear":4,"carb":1},{"mpg":21.4,"cyl":6,"disp":258,"hp":110,"drat":3.08,"wt":3.215,"qsec":19.44,"vs":1,"am":0,"gear":3,"carb":1},{"mpg":18.7,"cyl":8,"disp":360,"hp":175,"drat":3.15,"wt":3.44,"qsec":17.02,"vs":0,"am":0,"gear":3,"carb":2},{"mpg":18.1,"cyl":6,"disp":225,"hp":105,"drat":2.76,"wt":3.46,"qsec":20.22,"vs":1,"am":0,"gear":3,"carb":1}] diff --git a/tests/testthat/test-json_reader.R b/tests/testthat/test-json_reader.R new file mode 100644 index 00000000..84b46284 --- /dev/null +++ b/tests/testthat/test-json_reader.R @@ -0,0 +1,36 @@ +test_path <- "custom_data/mtcars.json" +target <- tibble::as_tibble(head(mtcars)) + +test_that("json_reader can read in a simple dataset", { + test <- json_reader(test_path) + expect_s3_class(test, "tbl_df") + expect_equal( + colnames(test), + colnames(target) + ) + attributes(test)$spec <- NULL + attributes(test)$problems <- NULL + expect_equal( + test, + target + ) +}) + +test_that("json_reader verbosity is controlled as expected", { + expect_gte( + length(capture.output(tmp <- json_reader(test_path, verbose = TRUE), + type = "message" + )), + 1 + ) + expect_equal( + length(capture.output(tmp <- json_reader(test_path, verbose = FALSE), + type = "message" + )), + 0 + ) +}) + +test_that("json_reader fails as expected when given a file that doesn't exist", { + expect_error(json_reader("nonsense.json", verbose = FALSE)) +}) From e48e358004b86eb06b54a1a92b751510fe78dbb4 Mon Sep 17 00:00:00 2001 From: Richard Martin-Nielsen Date: Mon, 27 Sep 2021 20:26:59 +0300 Subject: [PATCH 02/18] Add tests for the download_JSON method --- NAMESPACE | 2 ++ R/test-DataClass.R | 43 ++++++++++++++++++++++++++++++ man/expect_clean_cols.Rd | 1 + man/expect_columns_contain_data.Rd | 1 + man/expect_processed_cols.Rd | 1 + man/test_cleaning.Rd | 1 + man/test_download.Rd | 1 + man/test_download_JSON.Rd | 33 +++++++++++++++++++++++ man/test_processing.Rd | 1 + man/test_return.Rd | 1 + 10 files changed, 85 insertions(+) create mode 100644 man/test_download_JSON.Rd diff --git a/NAMESPACE b/NAMESPACE index 35d1f272..30a995e7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -41,6 +41,7 @@ export(start_using_memoise) export(stop_using_memoise) export(test_cleaning) export(test_download) +export(test_download_JSON) export(test_processing) export(test_return) importFrom(R6,R6Class) @@ -74,6 +75,7 @@ importFrom(dplyr,pull) importFrom(dplyr,recode) importFrom(dplyr,rename) importFrom(dplyr,select) +importFrom(dplyr,slice_head) importFrom(dplyr,slice_tail) importFrom(dplyr,starts_with) importFrom(dplyr,summarise) diff --git a/R/test-DataClass.R b/R/test-DataClass.R index e6f7f2fd..f0f48282 100644 --- a/R/test-DataClass.R +++ b/R/test-DataClass.R @@ -121,6 +121,49 @@ test_download <- function(DataClass_obj, download, snapshot_path) { } } + +#' Test download method for JSON files works correctly +#' @description Test data can be downloaded if `download = TRUE`, or a requested +#' snapshot file is not found, and store a snap shot in the `snapshot_dir`. If +#' an existing snapshot file is found then load this data to use in future tests +#' @param DataClass_obj The R6Class object to perform checks on. +#' Must be a `DataClass` or `DataClass` child object. +#' @param download Logical check to download or use a snapshot of the data +#' @param snapshot_path character_array the path to save the downloaded +#' snapshot to. +#' @importFrom purrr map walk +#' @importFrom dplyr slice_head +#' @family tests +#' @concept tests +#' @export +test_download_JSON <- function(DataClass_obj, download, snapshot_path) { + if (!file.exists(snapshot_path)) { + download <- TRUE + } + if (download) { + testthat::test_that( + paste0(DataClass_obj$data_name, " downloads sucessfully"), + { + DataClass_obj$download_JSON() + walk(DataClass_obj$data$raw, function(data) { + testthat::expect_s3_class(data, "data.frame") + testthat::expect_true(nrow(data) > 0) + testthat::expect_true(ncol(data) >= 2 + || typeof(data[[1]]) == "list") + }) + } + ) + DataClass_obj$data$raw <- map(vn$data$raw, + slice_head, + n = 2 + ) + + saveRDS(DataClass_obj$data$raw, snapshot_path) + } else { + DataClass_obj$data$raw <- readRDS(snapshot_path) + } +} + #' Test clean method works correctly #' @description Test data can be cleaned properly. The clean method is invoked #' to generate clean data. This data is checked to ensure it is a data.frame, diff --git a/man/expect_clean_cols.Rd b/man/expect_clean_cols.Rd index 4cbfc03e..c5165fef 100644 --- a/man/expect_clean_cols.Rd +++ b/man/expect_clean_cols.Rd @@ -20,6 +20,7 @@ Functions used for testing data is cleaned and processed correctly \code{\link{expect_columns_contain_data}()}, \code{\link{expect_processed_cols}()}, \code{\link{test_cleaning}()}, +\code{\link{test_download_JSON}()}, \code{\link{test_download}()}, \code{\link{test_processing}()}, \code{\link{test_return}()} diff --git a/man/expect_columns_contain_data.Rd b/man/expect_columns_contain_data.Rd index 75439ae5..3c97b657 100644 --- a/man/expect_columns_contain_data.Rd +++ b/man/expect_columns_contain_data.Rd @@ -19,6 +19,7 @@ Functions used for testing data is cleaned and processed correctly \code{\link{expect_clean_cols}()}, \code{\link{expect_processed_cols}()}, \code{\link{test_cleaning}()}, +\code{\link{test_download_JSON}()}, \code{\link{test_download}()}, \code{\link{test_processing}()}, \code{\link{test_return}()} diff --git a/man/expect_processed_cols.Rd b/man/expect_processed_cols.Rd index ad96cf9e..ae79949d 100644 --- a/man/expect_processed_cols.Rd +++ b/man/expect_processed_cols.Rd @@ -23,6 +23,7 @@ Functions used for testing data is cleaned and processed correctly \code{\link{expect_clean_cols}()}, \code{\link{expect_columns_contain_data}()}, \code{\link{test_cleaning}()}, +\code{\link{test_download_JSON}()}, \code{\link{test_download}()}, \code{\link{test_processing}()}, \code{\link{test_return}()} diff --git a/man/test_cleaning.Rd b/man/test_cleaning.Rd index c7f7414d..4194c5a0 100644 --- a/man/test_cleaning.Rd +++ b/man/test_cleaning.Rd @@ -22,6 +22,7 @@ Functions used for testing data is cleaned and processed correctly \code{\link{expect_clean_cols}()}, \code{\link{expect_columns_contain_data}()}, \code{\link{expect_processed_cols}()}, +\code{\link{test_download_JSON}()}, \code{\link{test_download}()}, \code{\link{test_processing}()}, \code{\link{test_return}()} diff --git a/man/test_download.Rd b/man/test_download.Rd index fb9c32ea..1cd01985 100644 --- a/man/test_download.Rd +++ b/man/test_download.Rd @@ -26,6 +26,7 @@ Functions used for testing data is cleaned and processed correctly \code{\link{expect_columns_contain_data}()}, \code{\link{expect_processed_cols}()}, \code{\link{test_cleaning}()}, +\code{\link{test_download_JSON}()}, \code{\link{test_processing}()}, \code{\link{test_return}()} } diff --git a/man/test_download_JSON.Rd b/man/test_download_JSON.Rd new file mode 100644 index 00000000..8d05564f --- /dev/null +++ b/man/test_download_JSON.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/test-DataClass.R +\name{test_download_JSON} +\alias{test_download_JSON} +\title{Test download method for JSON files works correctly} +\usage{ +test_download_JSON(DataClass_obj, download, snapshot_path) +} +\arguments{ +\item{DataClass_obj}{The R6Class object to perform checks on. +Must be a \code{DataClass} or \code{DataClass} child object.} + +\item{download}{Logical check to download or use a snapshot of the data} + +\item{snapshot_path}{character_array the path to save the downloaded +snapshot to.} +} +\description{ +Test data can be downloaded if \code{download = TRUE}, or a requested +snapshot file is not found, and store a snap shot in the \code{snapshot_dir}. If +an existing snapshot file is found then load this data to use in future tests +} +\seealso{ +Functions used for testing data is cleaned and processed correctly +\code{\link{expect_clean_cols}()}, +\code{\link{expect_columns_contain_data}()}, +\code{\link{expect_processed_cols}()}, +\code{\link{test_cleaning}()}, +\code{\link{test_download}()}, +\code{\link{test_processing}()}, +\code{\link{test_return}()} +} +\concept{tests} diff --git a/man/test_processing.Rd b/man/test_processing.Rd index 6b7ebb31..3b698d3c 100644 --- a/man/test_processing.Rd +++ b/man/test_processing.Rd @@ -25,6 +25,7 @@ Functions used for testing data is cleaned and processed correctly \code{\link{expect_columns_contain_data}()}, \code{\link{expect_processed_cols}()}, \code{\link{test_cleaning}()}, +\code{\link{test_download_JSON}()}, \code{\link{test_download}()}, \code{\link{test_return}()} } diff --git a/man/test_return.Rd b/man/test_return.Rd index 69715cf9..02f66f34 100644 --- a/man/test_return.Rd +++ b/man/test_return.Rd @@ -22,6 +22,7 @@ Functions used for testing data is cleaned and processed correctly \code{\link{expect_columns_contain_data}()}, \code{\link{expect_processed_cols}()}, \code{\link{test_cleaning}()}, +\code{\link{test_download_JSON}()}, \code{\link{test_download}()}, \code{\link{test_processing}()} } From 8790ebfa98866e53395a37a71fbd8897c9764a88 Mon Sep 17 00:00:00 2001 From: Richard Martin-Nielsen Date: Sun, 3 Oct 2021 17:48:12 +0300 Subject: [PATCH 03/18] Fixing reference to non-existent dataframe --- R/test-DataClass.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/test-DataClass.R b/R/test-DataClass.R index f0f48282..6a5a8bf0 100644 --- a/R/test-DataClass.R +++ b/R/test-DataClass.R @@ -153,7 +153,7 @@ test_download_JSON <- function(DataClass_obj, download, snapshot_path) { }) } ) - DataClass_obj$data$raw <- map(vn$data$raw, + DataClass_obj$data$raw <- map(DataClass_obj$data$raw, slice_head, n = 2 ) From e1afd3188e63dc99da1792f26da7e25501db584a Mon Sep 17 00:00:00 2001 From: Richard Martin-Nielsen Date: Thu, 2 Dec 2021 19:18:25 +0200 Subject: [PATCH 04/18] Update NEWS with JSON tests --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index 4a270315..6ba4cd6a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,8 @@ This release is currently under development * Change the data source for Switzerland to draw data from the Swiss Federal Office of Public Health (FOPH) * Updated the package logo to include the newly supported data sets. * Reduced the number of package dependencies (@bisaloo and @RichardMN) +* Added tests for JSON download code (@RichardMN). + ## Bug fixes - Fixed a bug in the data sourced from Germany so that instead of treating it as a line list of individuals it is treated as a relatively finely resolved count data which needs to be summed up (by @sbfnk). From f9672ac7f3805b9c8d116d28d9e51d841504f1ea Mon Sep 17 00:00:00 2001 From: Hugo Gruson Date: Fri, 4 Feb 2022 17:08:14 +0100 Subject: [PATCH 05/18] Use less strict tests for JSON input data Since we cannot assume it will always be rectangular before the cleaning step --- R/test-DataClass.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/R/test-DataClass.R b/R/test-DataClass.R index 6a5a8bf0..ac9867ed 100644 --- a/R/test-DataClass.R +++ b/R/test-DataClass.R @@ -146,10 +146,8 @@ test_download_JSON <- function(DataClass_obj, download, snapshot_path) { { DataClass_obj$download_JSON() walk(DataClass_obj$data$raw, function(data) { - testthat::expect_s3_class(data, "data.frame") - testthat::expect_true(nrow(data) > 0) - testthat::expect_true(ncol(data) >= 2 - || typeof(data[[1]]) == "list") + testthat::expect_true(length(data) > 0) + testthat::expect_false(is.null(data)) }) } ) From c048eb88538654836d197fa2bd3f71323e0e8904 Mon Sep 17 00:00:00 2001 From: Richard Martin-Nielsen Date: Sat, 29 Jan 2022 21:48:43 +0200 Subject: [PATCH 06/18] Adjustment to check Netherlands works without Hospitalisation data --- R/Netherlands.R | 8 ++++---- data/all_country_data.rda | Bin 3031 -> 3012 bytes .../custom_data/Netherlands_level_1.rds | Bin 5611 -> 5771 bytes .../custom_data/Netherlands_level_2.rds | Bin 5611 -> 5771 bytes 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/Netherlands.R b/R/Netherlands.R index a4afdf05..ef51194e 100644 --- a/R/Netherlands.R +++ b/R/Netherlands.R @@ -38,7 +38,7 @@ Netherlands <- R6::R6Class("Netherlands", ), # nolint end #' @field source_data_cols existing columns within the raw data - source_data_cols = c("cases_new", "deaths_new", "hosp_new"), + source_data_cols = c("cases_new", "deaths_new"), #, "hosp_new" #' @field source_text Plain text description of the source of the data source_text = "National Institute for Public Health and the Environment (RIVM), Netherlands", # nolint #' @field source_url Website address for explanation/introduction of the @@ -60,7 +60,7 @@ Netherlands <- R6::R6Class("Netherlands", mutate( Date_of_publication = ymd(.data$Date_of_publication), Total_reported = as.double(.data$Total_reported), - Hospital_admission = as.double(.data$Hospital_admission), + #Hospital_admission = as.double(.data$Hospital_admission), Deceased = as.double(.data$Deceased), level_1_region_code = sub("[a-z].*-", "", .data$Province), level_1_region_code = paste0( @@ -74,8 +74,8 @@ Netherlands <- R6::R6Class("Netherlands", level_2_region = .data$Municipality_name, level_2_region_code = .data$Municipality_code, cases_new = .data$Total_reported, - deaths_new = .data$Deceased, - hosp_new = .data$Hospital_admission + deaths_new = .data$Deceased #, + #hosp_new = .data$Hospital_admission ) }, diff --git a/data/all_country_data.rda b/data/all_country_data.rda index 5e83bf89bf24c904cddb6dfa807d559d772bf0c9..5a05afe290c0659921f355e1bad5c75b95169c99 100644 GIT binary patch literal 3012 zcmV;#3p?~eT4*^jL0KkKSuc=U5C8{A|Mma>Z~y-P|Nj5~-|)Zx-|#>H005vs2m*k> z00H0(y*}mEyPAPUpfQW?bCQ%6cXXm_ZoqU-)F6^cl){w#Ou|oSnW~4H*pqr=-cC^)%DcX`nP20DsaF z!KRyf>KU?04(BjFr-79IYfVUTbI5_t$YJ~YROEhnv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6T~gQeXuwe$@(E^S8g2#W$FCpChAa+g#_ z*^4LzjG3qCF%;ZXF613p^T$|pj!xN(Ghl8ygGTkND=iEM0JTMlcrYf(m%E4JOanoX zmk?QuD#VO6Ux^a%`sCy4s_)PK7YsDqH{|P=7z$G2BLfM0$dsG|9v2XJxfKnlW>~0< zg5cWZDP@qOOckPWn>TMS8(3x_v-Oa6k8i!^Ex-iyizoX*u+N70#O6W`K{AE51)zi* zD`qojXH-onQfIik3Q2cEV7}R`Rtz}D^6vV5(~5?L;i2GfM5tk^;zAajV1)klSEI;m zK{PH6mVf}v0;nzCo&8;JrH(VdZRb!gP(DDIX*-T1xzo(aR`*UBiJ1Cb;J`cm^8PW?^dVaU;bQFwylV5O6&o_!x7zy4M^x+rxeIwmazxJ+dDft zE!iR?kWlM9g|>ol*v=w#+~SN zxpPUmN<4a5p0F@WQFB64B0<=WAoO;1S%Pi^lG90zRSi^0fS|ximHUkeJ8ZsJTM zL3x5>TNd|97ae`fLSPnv3~w-U`#;gs(qcPh65o{y2Y-s7ZD&# z3qs!#O}wKrO>_#>gh{6hIe^ru7ui1$O2S3~$_Xii z#sQg44lJOpjS#^B9va!2H5Z;U3h_))2K{%?CCw-{>-BdB2S{RAS%y2&RTAQ8vdGeO z1vsu{R2OYbaKM}lkSsHg1e%~+@Y`9cXBpraE)G~9qaASQy2@DjXvot-?& z6g-@?y#pZN(V6o)t1W9r*2sg5Gc*Syvuq_Oj{D!jL4isVP8W+R7nQ%rjim}N<-7g+ ZPW#<`EHV%=!azOZ?ntK!5)7qX-5|wgg^>UN diff --git a/tests/testthat/custom_data/Netherlands_level_1.rds b/tests/testthat/custom_data/Netherlands_level_1.rds index ceff2ca38324a4a1e6367c146ddf6d2c9c2c2fea..262a43e3c8cdba974978f047145aaf51a6f36d2a 100644 GIT binary patch literal 5771 zcmV;67If(!iwFP!000001MNLcbK6LEw5(6+!;(Ggouqau%vLJdY%M1wB@#q7$x5_r zX~vSJm1Jq6*{ltbEfN+;Fd!g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wXFg^h+jIxhd5Bl~C`Okg4b3K`KSND1Dj}h{vqw{S#e34&T{)6z7`h8TN zVeL2U{!!7F<w3w%O~~@{!pot^J;-oFA2cWb~7Meg$!IE6(+_ zpT7QSM0Bou|ETGFDW6}PJ+kV1TkUjP<@($|<9ajxB>POKU09IIJP8=QJt3;@oV>M(b)f}x=XSQ25B+^iyFJqZ z^qy`cc&TUIw9hrVpmxqQ+Ya$(R!N(vHeh1Y&06N=GiJU8_P#|olm}5 z@A@02oFn~h=h%nt0_0!jJF25TJGQ7=n8$>DPTGL`&?A$(^U(8B5B|z0&v1R$-u)!Z zPaT`qnd%5a-C=sS=~sVk$F$yp6vWX2)6NDf0Q@piri++q9K)Q1#KVw8`$V Date: Sat, 5 Feb 2022 18:45:52 +0000 Subject: [PATCH 07/18] update news with #448 details --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 8062c9c0..8ba7bf2f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,7 @@ This release is currently under development - Fixed a bug in `fill_empty_dates_with_na()` caused by changes made in version `1.2.0` of `tidyr`. - Fixed a bug in the data sourced from Germany so that instead of treating it as a line list of individuals it is treated as a relatively finely resolved count data which needs to be summed up (by @sbfnk). +- Fixed a bug in the Vietnam class due to `stringr` ([#448](https://github.com/epiforecasts/covidregionaldata/pull/448) by @RichardMN) # covidregionaldata 0.9.2 From 5266915cf68f55c79d055886d256de977fe31d5c Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 18:50:16 +0000 Subject: [PATCH 08/18] depreciate get_interventions --- NEWS.md | 4 +++ R/get_interventions_data.R | 58 -------------------------------------- 2 files changed, 4 insertions(+), 58 deletions(-) delete mode 100644 R/get_interventions_data.R diff --git a/NEWS.md b/NEWS.md index 8ba7bf2f..7ba74355 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,6 +19,10 @@ This release is currently under development - Fixed a bug in the data sourced from Germany so that instead of treating it as a line list of individuals it is treated as a relatively finely resolved count data which needs to be summed up (by @sbfnk). - Fixed a bug in the Vietnam class due to `stringr` ([#448](https://github.com/epiforecasts/covidregionaldata/pull/448) by @RichardMN) +## Depreciations + +- `get_interventions_data()` has been depreciated. + # covidregionaldata 0.9.2 This release adds support for the Covid19 Data Hub which includes Google and Apple mobility data amongst a large range of other data sets, data from the European Commission's Joint Research Centre which is at both the regional and national level, and individual sources for regional data from several countries. Package updates have been made in line with a software review at the [Journal of Open Source Software](https://github.com/openjournals/joss-reviews/issues/3290). Finally, this release exposes more of the testing infrastructure to users and adds a package hexsticker. diff --git a/R/get_interventions_data.R b/R/get_interventions_data.R deleted file mode 100644 index 37dfa4cc..00000000 --- a/R/get_interventions_data.R +++ /dev/null @@ -1,58 +0,0 @@ -#' Get ACAPS Government Interventions dataset -#' -#' @description -#' `r lifecycle::badge("deprecated")` -#' -#' Downloads the ACAPS Government Interventions dataset. -#' This function is deprecated: data are no longer updated as of December 2020. -#' -#' Over 100 alternative datasets are available, covering government -#' interventions worldwide. Several include subnational level policy. -#' See: https://supertracker.spi.ox.ac.uk/policy-trackers/ -#' -#' @return a dataframe of government interventions up to Dec 2020 from ACAPS -#' @source \url{https://www.acaps.org/covid-19-government-measures-dataset} -#' @author Paul Campbell @paulcampbell91 -#' -#' @keywords internal -#' -#' @importFrom readxl read_excel -#' @importFrom dplyr mutate -#' @importFrom utils download.file -#' @importFrom lifecycle deprecate_warn -#' -get_interventions_data <- function() { - deprecate_warn( - when = "0.9.0", - what = "covidregionaldata::get_interventions_data()", - details = c( - "The ACAPS data source stopped updating in December 2020.", - "Over 100 alternative data sets are available at:", - "https://supertracker.spi.ox.ac.uk/policy-trackers/" - ) - ) - - base_url <- "https://www.acaps.org/sites/acaps/files/resources/files/acaps_covid19_government_measures_dataset_0.xlsx" # nolint - temp <- tempdir() - filename <- "interventions.xlsx" - download.file(base_url, - destfile = file.path(temp, filename), - mode = "wb", quiet = TRUE - ) - # Read in data and correct excel dates - data <- suppressWarnings(read_excel(file.path(temp, filename), - sheet = "Dataset", - col_types = "text" - )) %>% - mutate( - ENTRY_DATE = as.Date((as.numeric(.data$ENTRY_DATE) - 2), - origin = as.Date("1900-01-01") - ), - DATE_IMPLEMENTED = as.Date((as.numeric(.data$DATE_IMPLEMENTED) - 2), - origin = as.Date("1900-01-01") - ) - ) - names(data) <- tolower(names(data)) - - return(data) -} From 88b2833e18f0399479bf0a4d814c9712e2812a4d Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 18:54:09 +0000 Subject: [PATCH 09/18] drop get_info_covidregionaldata --- NEWS.md | 1 + R/get_info_covidregionaldata.R | 18 ------------ man/get_info_covidregionaldata.Rd | 14 ---------- man/get_interventions_data.Rd | 28 ------------------- .../test-get_info_covidregionaldata.R | 6 ---- 5 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 R/get_info_covidregionaldata.R delete mode 100644 man/get_info_covidregionaldata.Rd delete mode 100644 man/get_interventions_data.Rd delete mode 100644 tests/testthat/test-get_info_covidregionaldata.R diff --git a/NEWS.md b/NEWS.md index 7ba74355..482a79ea 100644 --- a/NEWS.md +++ b/NEWS.md @@ -23,6 +23,7 @@ This release is currently under development - `get_interventions_data()` has been depreciated. + # covidregionaldata 0.9.2 This release adds support for the Covid19 Data Hub which includes Google and Apple mobility data amongst a large range of other data sets, data from the European Commission's Joint Research Centre which is at both the regional and national level, and individual sources for regional data from several countries. Package updates have been made in line with a software review at the [Journal of Open Source Software](https://github.com/openjournals/joss-reviews/issues/3290). Finally, this release exposes more of the testing infrastructure to users and adds a package hexsticker. diff --git a/R/get_info_covidregionaldata.R b/R/get_info_covidregionaldata.R deleted file mode 100644 index 632d77c1..00000000 --- a/R/get_info_covidregionaldata.R +++ /dev/null @@ -1,18 +0,0 @@ -#' Get available datasets -#' -#' @description -#' `r lifecycle::badge("deprecated")` -#' -#' This function is deprecated. Please use `get_available_datasets()` instead. -#' -#' @keywords internal -#' @importFrom lifecycle deprecate_warn -get_info_covidregionaldata <- function() { - deprecate_warn( - when = "0.9.0", - what = "covidregionaldata::get_info_covidregionaldata()", - with = "covidregionaldata::get_available_datasets()" - ) - data <- get_available_datasets() - return(data) -} diff --git a/man/get_info_covidregionaldata.Rd b/man/get_info_covidregionaldata.Rd deleted file mode 100644 index f656ae0c..00000000 --- a/man/get_info_covidregionaldata.Rd +++ /dev/null @@ -1,14 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/get_info_covidregionaldata.R -\name{get_info_covidregionaldata} -\alias{get_info_covidregionaldata} -\title{Get available datasets} -\usage{ -get_info_covidregionaldata() -} -\description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} - -This function is deprecated. Please use \code{get_available_datasets()} instead. -} -\keyword{internal} diff --git a/man/get_interventions_data.Rd b/man/get_interventions_data.Rd deleted file mode 100644 index f8e8c870..00000000 --- a/man/get_interventions_data.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/get_interventions_data.R -\name{get_interventions_data} -\alias{get_interventions_data} -\title{Get ACAPS Government Interventions dataset} -\source{ -\url{https://www.acaps.org/covid-19-government-measures-dataset} -} -\usage{ -get_interventions_data() -} -\value{ -a dataframe of government interventions up to Dec 2020 from ACAPS -} -\description{ -\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} - -Downloads the ACAPS Government Interventions dataset. -This function is deprecated: data are no longer updated as of December 2020. - -Over 100 alternative datasets are available, covering government -interventions worldwide. Several include subnational level policy. -See: https://supertracker.spi.ox.ac.uk/policy-trackers/ -} -\author{ -Paul Campbell @paulcampbell91 -} -\keyword{internal} diff --git a/tests/testthat/test-get_info_covidregionaldata.R b/tests/testthat/test-get_info_covidregionaldata.R deleted file mode 100644 index 1ef53bcd..00000000 --- a/tests/testthat/test-get_info_covidregionaldata.R +++ /dev/null @@ -1,6 +0,0 @@ -test_that("get_info_covidregionaldata works as expected", { - expect_warning(get_info_covidregionaldata()) - expect_s3_class( - suppressWarnings(get_info_covidregionaldata()), "data.frame" - ) -}) From c6c36a3c0af8d7cfc0f5ebdc7b5d3aef78807920 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 18:57:17 +0000 Subject: [PATCH 10/18] drop the country arg from get_national_data --- NEWS.md | 5 +++-- R/get_national_data.R | 11 ----------- man/get_national_data.Rd | 4 ---- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/NEWS.md b/NEWS.md index 482a79ea..36bbb08a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -21,8 +21,9 @@ This release is currently under development ## Depreciations -- `get_interventions_data()` has been depreciated. - +- `get_interventions_data()` has been depreciated and removed. +- `get_info_covidregionaldata()` has been depreciated and removed. +- The `country` argument to `get_national_data()` has been depreciated and removed. It's functionality can be replicated using the `countries` argument. # covidregionaldata 0.9.2 diff --git a/R/get_national_data.R b/R/get_national_data.R index 00cde97f..bb5628e3 100644 --- a/R/get_national_data.R +++ b/R/get_national_data.R @@ -12,8 +12,6 @@ #' #' @param countries A character vector specifying country names of interest. #' Used to filter the data. -#' @param country `r lifecycle::badge("deprecated")` A character string -#' specifying a country to filter for. #' @param source A character string specifying the data source (not case #' dependent). Defaults to WHO (the World Health Organisation). See #' `get_available_datasets("national")` for all options. @@ -54,16 +52,7 @@ #' } get_national_data <- function(countries, source = "who", level = "1", totals = FALSE, steps = FALSE, class = FALSE, verbose = TRUE, - country = deprecated(), ...) { - if (is_present(country)) { - deprecate_warn( - "0.9.0", - "covidregionaldata::get_national_data(country = )", - "covidregionaldata::get_national_data(countries = )" - ) - countries <- country - } # check data availability and initiate country class if available nation_class <- initialise_dataclass( diff --git a/man/get_national_data.Rd b/man/get_national_data.Rd index 098ca65b..9b19b25a 100644 --- a/man/get_national_data.Rd +++ b/man/get_national_data.Rd @@ -12,7 +12,6 @@ get_national_data( steps = FALSE, class = FALSE, verbose = TRUE, - country = deprecated(), ... ) } @@ -43,9 +42,6 @@ Overrides \code{steps}.} \item{verbose}{Logical, defaults to \code{TRUE}. Should verbose processing messages and warnings be returned.} -\item{country}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} A character string -specifying a country to filter for.} - \item{...}{Additional arguments to pass to class specific functionality.} } \value{ From 927d9f10b8be47781e9e83d4c87831bc3fb47e0b Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 18:59:39 +0000 Subject: [PATCH 11/18] update tests for get_national_data --- NEWS.md | 2 +- tests/testthat/test-get_national_data.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index 36bbb08a..0e5d98d8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,7 +17,7 @@ This release is currently under development - Fixed a bug in `fill_empty_dates_with_na()` caused by changes made in version `1.2.0` of `tidyr`. - Fixed a bug in the data sourced from Germany so that instead of treating it as a line list of individuals it is treated as a relatively finely resolved count data which needs to be summed up (by @sbfnk). -- Fixed a bug in the Vietnam class due to `stringr` ([#448](https://github.com/epiforecasts/covidregionaldata/pull/448) by @RichardMN) +- Fixed a bug in the Vietnam class due to `stringr` ([#448](https://github.com/epiforecasts/covidregionaldata/pull/448) by @RichardMN). ## Depreciations diff --git a/tests/testthat/test-get_national_data.R b/tests/testthat/test-get_national_data.R index 4caed1a2..9133e4ce 100644 --- a/tests/testthat/test-get_national_data.R +++ b/tests/testthat/test-get_national_data.R @@ -27,7 +27,7 @@ test_get_national_data <- function(source) { verbose = FALSE )) expect_warning(get_national_data( - country = "Zimbabwe", source = source, + countries = "Zimbabwe", source = source, verbose = FALSE )) expect_equal( From aff45c63b8bebf9c7b6eb111195e4c62a47c762b Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 19:01:41 +0000 Subject: [PATCH 12/18] drop dep args from get_regional_data --- R/get_regional_data.R | 26 ------------------------- tests/testthat/test-get_regional_data.R | 13 ------------- 2 files changed, 39 deletions(-) diff --git a/R/get_regional_data.R b/R/get_regional_data.R index bf533566..f3bbb97d 100644 --- a/R/get_regional_data.R +++ b/R/get_regional_data.R @@ -13,11 +13,6 @@ #' @param country A character string specifying the country to get data from. #' Not case dependent. Name should be the English name. For a list of #' options use `get_available_datasets()`. -#' @param include_level_2_regions `r lifecycle::badge("deprecated")` Boolean. If TRUE, returns data stratified by -#' level 2 regions. If FALSE, stratified by Level 1. Note that Level 2 region -#' data is not always available. In these cases the user will get a warning -#' and the Level 1 data will be returned. -#' @param localise_regions `r lifecycle::badge("deprecated")` Logical, defaults to TRUE. Should region names be localised. #' @inheritParams return_data #' @inheritParams initialise_dataclass #' @return A tibble with data related to cases, deaths, hospitalisations, @@ -47,28 +42,7 @@ get_regional_data <- function(country, level = "1", totals = FALSE, localise = TRUE, steps = FALSE, class = FALSE, verbose = TRUE, regions, - include_level_2_regions = deprecated(), - localise_regions = deprecated(), ...) { - if (is_present(include_level_2_regions)) { - deprecate_warn( - "0.9.0", - "covidregionaldata::get_regional_data(include_level_2_regions = )", "covidregionaldata::get_regional_data(level = )" - ) - if (include_level_2_regions) { - level <- "1" - } else { - level <- "2" - } - } - - if (is_present(localise_regions)) { - deprecate_warn( - "0.9.0", - "covidregionaldata::get_regional_data(localise_regions = )", "covidregionaldata::get_regional_data(localise = )" - ) - localise <- localise_regions - } # check data availability and initiate country class if available region_class <- initialise_dataclass( diff --git a/tests/testthat/test-get_regional_data.R b/tests/testthat/test-get_regional_data.R index ec826ad6..1cc59b90 100644 --- a/tests/testthat/test-get_regional_data.R +++ b/tests/testthat/test-get_regional_data.R @@ -46,19 +46,6 @@ test_get_regional_data <- function(level) { verbose = FALSE ) ) - # test depreciated args - if (level == "2") { - expect_warning(get_regional_data("mexico", - level = level, - include_level_2_regions = TRUE, verbose = FALSE - )) - expect_warning( - get_regional_data("mexico", - localise_regions = TRUE, - verbose = FALSE - ) - ) - } }) } From 6700bc288f572567e715a55eb60f4b68d0eba962 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 19:09:37 +0000 Subject: [PATCH 13/18] switch get_linelist to depreciate_stop vs warn --- NAMESPACE | 4 +--- R/get_linelist.R | 4 ++-- R/get_national_data.R | 1 - R/get_regional_data.R | 1 - man/get_regional_data.Rd | 9 --------- 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index e1363830..51a779b0 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -89,9 +89,7 @@ importFrom(httr,POST) importFrom(httr,content) importFrom(httr,status_code) importFrom(jsonlite,fromJSON) -importFrom(lifecycle,deprecate_warn) -importFrom(lifecycle,deprecated) -importFrom(lifecycle,is_present) +importFrom(lifecycle,deprecate_stop) importFrom(lubridate,as_date) importFrom(lubridate,dmy) importFrom(lubridate,mdy) diff --git a/R/get_linelist.R b/R/get_linelist.R index 6b5f48ca..2f2d11f8 100644 --- a/R/get_linelist.R +++ b/R/get_linelist.R @@ -21,7 +21,7 @@ #' #' @keywords internal #' -#' @importFrom lifecycle deprecate_warn +#' @importFrom lifecycle deprecate_stop #' @importFrom dplyr if_else select mutate filter #' @importFrom lubridate dmy #' @importFrom utils download.file untar @@ -35,7 +35,7 @@ #' } #' get_linelist <- function(clean = TRUE, report_delay_only = FALSE) { - deprecate_warn( + deprecate_stop( when = "0.9.0", what = "covidregionaldata::get_linelist()", details = c( diff --git a/R/get_national_data.R b/R/get_national_data.R index bb5628e3..0645435c 100644 --- a/R/get_national_data.R +++ b/R/get_national_data.R @@ -18,7 +18,6 @@ #' @return A tibble with data related to cases, deaths, hospitalisations, #' recoveries and testing. #' @inheritParams get_regional_data -#' @importFrom lifecycle deprecated is_present deprecate_warn #' @family interface #' @seealso [WHO()], [ECDC()], [JHU()], [Google()] #' @export diff --git a/R/get_regional_data.R b/R/get_regional_data.R index f3bbb97d..34ae99a0 100644 --- a/R/get_regional_data.R +++ b/R/get_regional_data.R @@ -17,7 +17,6 @@ #' @inheritParams initialise_dataclass #' @return A tibble with data related to cases, deaths, hospitalisations, #' recoveries and testing stratified by regions within the given country. -#' @importFrom lifecycle deprecated is_present deprecate_warn #' @family interface #' @seealso [Italy()], [UK()] #' @export diff --git a/man/get_regional_data.Rd b/man/get_regional_data.Rd index de52bb4f..e825493b 100644 --- a/man/get_regional_data.Rd +++ b/man/get_regional_data.Rd @@ -13,8 +13,6 @@ get_regional_data( class = FALSE, verbose = TRUE, regions, - include_level_2_regions = deprecated(), - localise_regions = deprecated(), ... ) } @@ -47,13 +45,6 @@ messages and warnings be returned.} \item{regions}{A character vector of target regions to be assigned to the \code{target_regions} field and used to filter the returned data.} -\item{include_level_2_regions}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Boolean. If TRUE, returns data stratified by -level 2 regions. If FALSE, stratified by Level 1. Note that Level 2 region -data is not always available. In these cases the user will get a warning -and the Level 1 data will be returned.} - -\item{localise_regions}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} Logical, defaults to TRUE. Should region names be localised.} - \item{...}{Additional arguments to pass to class specific functionality.} } \value{ From 2d31173f4a1e6011b3b8373acf24b4857382be19 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 19:10:36 +0000 Subject: [PATCH 14/18] update news --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index 0e5d98d8..d54d70be 100644 --- a/NEWS.md +++ b/NEWS.md @@ -24,6 +24,7 @@ This release is currently under development - `get_interventions_data()` has been depreciated and removed. - `get_info_covidregionaldata()` has been depreciated and removed. - The `country` argument to `get_national_data()` has been depreciated and removed. It's functionality can be replicated using the `countries` argument. +- `get_linelist()` has been updated to fail on use vs warn on use and will be removed from future versions of the package. # covidregionaldata 0.9.2 From e2079d2fb52d6d3aacba622689bfea4dd0e0e413 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 19:27:00 +0000 Subject: [PATCH 15/18] update package checking --- .github/workflows/R-CMD-check.yaml | 46 +++++ .github/workflows/check-full.yaml | 272 --------------------------- .github/workflows/lint.yaml | 49 +++++ .github/workflows/test-coverage.yaml | 59 ++++++ README.Rmd | 2 +- 5 files changed, 155 insertions(+), 273 deletions(-) create mode 100644 .github/workflows/R-CMD-check.yaml delete mode 100644 .github/workflows/check-full.yaml create mode 100644 .github/workflows/lint.yaml create mode 100644 .github/workflows/test-coverage.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 00000000..271d466e --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,46 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/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 + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macOS-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-pandoc@v1 + + - uses: r-lib/actions/setup-r@v1 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v1 + with: + extra-packages: rcmdcheck + + - uses: r-lib/actions/check-r-package@v1 diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml deleted file mode 100644 index 5e099a4c..00000000 --- a/.github/workflows/check-full.yaml +++ /dev/null @@ -1,272 +0,0 @@ ---- -# Github Actions workflow to check covidregionaldata -name: R-CMD-check - -'on': - push: - branches: - - master - schedule: - - cron: '0 0 * * 1' - pull_request: - branches: - - '*' - workflow_dispatch: - -jobs: - R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: true - matrix: - config: - - {os: macOS-latest, r: 'release'} - - {os: windows-latest, r: 'release'} - - {os: ubuntu-20.04, r: 'release'} - - {os: ubuntu-20.04, r: 'oldrel'} - - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - with: - r-version: ${{ matrix.config.r }} - - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - sudo apt-get -y install libudunits2-dev libgdal-dev libqpdf-dev libcurl4-openssl-dev - shell: bash - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("rcmdcheck") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_: false - _R_CHECK_DONTTEST_EXAMPLES_: false - _R_CHECK_FORCE_SUGGESTS_: false - run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check") - shell: Rscript {0} - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@v2 - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check - - Lint: - runs-on: ubuntu-20.04 - - needs: [R-CMD-check] - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - sudo apt-get -y install libudunits2-dev libgdal-dev libqpdf-dev libcurl4-openssl-dev - shell: bash - - - name: Install dependencies - run: | - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("lintr") - remotes::install_cran("sessioninfo") - remotes::install_local(".") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Lint - run: lintr::lint_package() - shell: Rscript {0} - - - test-coverage: - if: github.repository == 'epiforecasts/covidregionaldata' - runs-on: ubuntu-20.04 - - needs: [R-CMD-check] - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install system dependencies - if: runner.os == 'Linux' - env: - RHUB_PLATFORM: linux-x86_64-ubuntu-gcc - run: | - while read -r cmd - do - eval sudo $cmd - done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))') - sudo apt-get -y install libudunits2-dev libgdal-dev libqpdf-dev libcurl4-openssl-dev - shell: bash - - - name: Install dependencies - run: | - install.packages(c("remotes","sessioninfo")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") - shell: Rscript {0} - - - name: Session info - run: | - options(width = 100) - pkgs <- installed.packages()[, "Package"] - sessioninfo::session_info(pkgs, include_base = TRUE) - shell: Rscript {0} - - - name: Test coverage - run: covr::codecov() - shell: Rscript {0} - - - pkgdown: - if: github.ref == 'refs/heads/master' && github.repository == 'epiforecasts/covidregionaldata' - runs-on: macOS-latest - - needs: [R-CMD-check, Lint, test-coverage] - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) - shell: Rscript {0} - - - name: Cache R packages - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: macOS-r-4.0-1- - - - name: Install dependencies - run: | - install.packages(c("remotes", "pkgbuild")) - remotes::install_deps(dependencies = TRUE) - remotes::install_dev("pkgdown") - shell: Rscript {0} - - - name: Install package - run: R CMD INSTALL . - - - name: Deploy package - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - Rscript -e "pkgdown::deploy_to_branch(new_process = FALSE, clean = TRUE)" - shell: bash diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 00000000..041ee3c8 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,49 @@ +on: + push: + branches: + - main + - master + pull_request: + branches: + - main + - master + +name: lint + +jobs: + lint: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Restore R package cache + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + install.packages(c("remotes")) + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("lintr") + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Lint + run: lintr::lint_package() + shell: Rscript {0} \ No newline at end of file diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml new file mode 100644 index 00000000..19db0001 --- /dev/null +++ b/.github/workflows/test-coverage.yaml @@ -0,0 +1,59 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/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: test-coverage + +jobs: + test-coverage: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + NOT_CRAN: true + steps: + - name: cmdstan env vars + run: | + echo "CMDSTAN_PATH=${HOME}/.cmdstan" >> $GITHUB_ENV + shell: bash + - uses: n1hility/cancel-previous-runs@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@v1 + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Restore R package cache + uses: actions/cache@v2 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + install.packages(c("remotes")) + remotes::install_deps(dependencies = TRUE) + remotes::install_cran("covr") + install.packages("curl") + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Test coverage + run: | + options(testRegions = TRUE) + covr::codecov() + shell: Rscript {0} \ No newline at end of file diff --git a/README.Rmd b/README.Rmd index a42bda15..04b68018 100644 --- a/README.Rmd +++ b/README.Rmd @@ -13,7 +13,7 @@ knitr::opts_chunk$set( # Subnational data for the COVID-19 outbreak -[![R-CMD-check](https://github.com/epiforecasts/covidregionaldata/workflows/R-CMD-check/badge.svg)](https://github.com/epiforecasts/covidregionaldata/actions) [![Codecov test coverage](https://codecov.io/gh/epiforecasts/covidregionaldata/branch/master/graph/badge.svg)](https://codecov.io/gh/epiforecasts/covidregionaldata?branch=master) [![Data status](https://img.shields.io/badge/Data-status-lightblue.svg?style=flat)](https://epiforecasts.io/covidregionaldata/articles/supported-countries.html) [![metacran downloads](http://cranlogs.r-pkg.org/badges/grand-total/covidregionaldata?color=ff69b4)](https://cran.r-project.org/package=covidregionaldata) + [![R-CMD-check](https://github.com/epiforecasts/covidregionaldata/workflows/R-CMD-check/badge.svg)](https://github.com/epiforecasts/covidregionaldata/actions) [![Codecov test coverage](https://codecov.io/gh/epiforecasts/covidregionaldata/branch/master/graph/badge.svg)](https://codecov.io/gh/epiforecasts/covidregionaldata?branch=master) [![Data status](https://img.shields.io/badge/Data-status-lightblue.svg?style=flat)](https://epiforecasts.io/covidregionaldata/articles/supported-countries.html) [![metacran downloads](http://cranlogs.r-pkg.org/badges/grand-total/covidregionaldata?color=ff69b4)](https://cran.r-project.org/package=covidregionaldata) [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/epiforecasts/covidregionaldata/blob/master/LICENSE.md/) [![GitHub contributors](https://img.shields.io/github/contributors/epiforecasts/covidregionaldata)](https://github.com/epiforecasts/covidregionaldata/graphs/contributors) [![Discord](https://img.shields.io/discord/864828485981306890?logo=Discord)](https://discord.gg/9YPDDADVt3) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-yellow.svg)](https://makeapullrequest.com/) [![GitHub commits](https://img.shields.io/github/commits-since/epiforecasts/covidregionaldata/0.9.2.svg?color=orange)](https://github.com/epiforecasts/covidregionaldata/commit/master/) From d1d64fba2271950eee9b34745c412a39849580b9 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 19:31:35 +0000 Subject: [PATCH 16/18] clean up tests --- R/shared-methods.R | 10 ++++++---- tests/testthat/test-get_national_data.R | 4 ---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/R/shared-methods.R b/R/shared-methods.R index 0433831e..8974d8ac 100644 --- a/R/shared-methods.R +++ b/R/shared-methods.R @@ -638,10 +638,12 @@ CountryDataClass <- R6::R6Class("CountryDataClass", } if (!is.null(self$target_regions)) { - self$target_regions <- countryname( - self$target_regions, - destination = "country.name.en", - warn = FALSE + self$target_regions <- suppressWarnings( + countryname( + self$target_regions, + destination = "country.name.en", + warn = FALSE + ) ) if (all(is.na(self$target_regions))) { stop("No countries found with target names") diff --git a/tests/testthat/test-get_national_data.R b/tests/testthat/test-get_national_data.R index 9133e4ce..de83e30e 100644 --- a/tests/testthat/test-get_national_data.R +++ b/tests/testthat/test-get_national_data.R @@ -26,10 +26,6 @@ test_get_national_data <- function(source) { countries = "rwfwf", source = source, verbose = FALSE )) - expect_warning(get_national_data( - countries = "Zimbabwe", source = source, - verbose = FALSE - )) expect_equal( true_steps, get_national_data(source = source, steps = TRUE, verbose = FALSE) From ed1a14d5254669ca6fd45e31ee212a84c6af0be8 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 19:51:28 +0000 Subject: [PATCH 17/18] drop commented code --- R/Netherlands.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/R/Netherlands.R b/R/Netherlands.R index ef51194e..5d9f4f10 100644 --- a/R/Netherlands.R +++ b/R/Netherlands.R @@ -38,7 +38,7 @@ Netherlands <- R6::R6Class("Netherlands", ), # nolint end #' @field source_data_cols existing columns within the raw data - source_data_cols = c("cases_new", "deaths_new"), #, "hosp_new" + source_data_cols = c("cases_new", "deaths_new"), #' @field source_text Plain text description of the source of the data source_text = "National Institute for Public Health and the Environment (RIVM), Netherlands", # nolint #' @field source_url Website address for explanation/introduction of the @@ -60,7 +60,6 @@ Netherlands <- R6::R6Class("Netherlands", mutate( Date_of_publication = ymd(.data$Date_of_publication), Total_reported = as.double(.data$Total_reported), - #Hospital_admission = as.double(.data$Hospital_admission), Deceased = as.double(.data$Deceased), level_1_region_code = sub("[a-z].*-", "", .data$Province), level_1_region_code = paste0( From 3eae8eefbeeef030c573caf2ae51994f46396e49 Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Sat, 5 Feb 2022 19:54:15 +0000 Subject: [PATCH 18/18] update news --- NEWS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS.md b/NEWS.md index aa770a9d..942c164e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,6 +19,7 @@ This release is currently under development - Fixed a bug in `fill_empty_dates_with_na()` caused by changes made in version `1.2.0` of `tidyr`. - Fixed a bug in the data sourced from Germany so that instead of treating it as a line list of individuals it is treated as a relatively finely resolved count data which needs to be summed up (by @sbfnk). - Fixed a bug in the Vietnam class due to `stringr` ([#448](https://github.com/epiforecasts/covidregionaldata/pull/448) by @RichardMN). +- Fixed a bug with the Netherlands class were the lack of Hospitalisation data in the source was causing the class to fail ([#446](https://github.com/epiforecasts/covidregionaldata/pull/446) by @RichardMN). ## Depreciations