diff --git a/DESCRIPTION b/DESCRIPTION index 8dae56ca..451c7a15 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: epidatr Type: Package Title: Client for Delphi's 'Epidata' API -Version: 1.1.5 +Version: 1.2.0 Authors@R: c( person("Logan", "Brooks", email = "lcbrooks@andrew.cmu.edu", role = c("aut")), diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 46d52ad9..792da66c 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -53,7 +53,7 @@ Open a release issue and then copy and follow this checklist in the issue (modif - [ ] `git pull` on `dev` branch. - [ ] Make sure all changes are committed and pushed. -- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epiprocess.html). +- [ ] Check [current CRAN check results](https://cran.rstudio.org/web/checks/check_results_epidatr.html). - [ ] `devtools::check(".", manual = TRUE, env_vars = c(NOT_CRAN = "false"))`. - Aim for 10/10, no notes. - [ ] If check works well enough, merge to main. Otherwise open a PR to fix up. diff --git a/NEWS.md b/NEWS.md index 699607bd..c8e837c3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,9 @@ - Improve handling of the `EPIDATR_USE_CACHE` environment variable, allowing it to be any value convertable by `as.logical()` and handle the case when it can't be converted. +- Support more date formats in function to convert dates to epiweeks. Use `parse_api_date` since it already supports both common formats. #276 +- `EPIDATR_USE_CACHE` only supported exactly "TRUE" before. Now it supports all logical values and includes a warning when any value that can't be converted to logical is provided. #273 +- `missing` doesn't count default values as non-missing. If a user doesn't pass `geo_values` or `time_values` (both of which default to `"*"` in `pub_covidcast`), or `dates` (in `pub_covid_hosp_state_timeseries`), the missing check fails. To avoid this, just don't check missingness of those two arguments. # epidatr 1.1.1 diff --git a/tests/testthat/test-cache.R b/tests/testthat/test-cache.R index 5ac9d57e..8d75644b 100644 --- a/tests/testthat/test-cache.R +++ b/tests/testthat/test-cache.R @@ -18,7 +18,7 @@ test_set_cache <- function(cache_dir = new_temp_dir, } test_that("cache set as expected", { - test_set_cache() + expect_message(test_set_cache()) if (grepl("/", as.character(new_temp_dir))) { # this is what check produces expect_equal(cache_info()$dir, normalizePath(new_temp_dir)) @@ -38,7 +38,7 @@ test_that("cache set as expected", { # use an existing example to save, then load and compare the values test_that("cache saves & loads", { - test_set_cache() + expect_message(test_set_cache()) epidata_call <- pub_covidcast( source = "jhu-csse", signals = "confirmed_7dav_incidence_prop", @@ -128,7 +128,7 @@ test_that("check_is_cachable", { expect_false(check_is_cachable(epidata_call, fetch_args)) } } - test_set_cache() + expect_message(test_set_cache()) check_fun(expected_result = FALSE) # doesn't specify issues or as_of check_fun(as_of = "2020-01-01", expected_result = TRUE) # valid as_of check_fun(issues = "2020-01-01", expected_result = TRUE) # valid issues @@ -178,14 +178,14 @@ test_that("check_is_cachable", { # cases where the cache isn't active disable_cache() check_fun(as_of = "2020-01-01", expected_result = FALSE) - test_set_cache() + expect_message(test_set_cache()) cache_environ$epidatr_cache <- NULL check_fun(as_of = "2020-01-01", expected_result = FALSE) - test_set_cache() + expect_message(test_set_cache()) check_fun(as_of = "2020-01-01", expected_result = TRUE) }) -test_set_cache() +expect_message(test_set_cache()) cache_environ$epidatr_cache$prune() clear_cache(disable = TRUE) rm(new_temp_dir)