Skip to content

Commit 2e4c722

Browse files
authored
Merge pull request #253 from cmu-delphi/post-1.0-release
1.1.0 pre-CRAN cleanup
2 parents aa6c641 + d39fb20 commit 2e4c722

15 files changed

+79
-24
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
^README\.Rmd$
2424
^CRAN-SUBMISSION$
2525
^LICENSE\.md$
26+
^revdep$

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Please:
44

55
- [ ] Make sure this PR is against "dev", not "main" (unless this is a release
66
PR).
7-
- [ ] Request a review from one of the current epiprocess main reviewers:
8-
brookslogan, nmdefries.
7+
- [ ] Request a review from one of the current epidatr main reviewers:
8+
brookslogan, dshemetov, nmdefries, dsweber2.
99
- [ ] Makes sure to bump the version number in `DESCRIPTION`. Always increment
1010
the patch version number (the third number), unless you are making a
1111
release PR from dev to main, in which case increment the minor version

DESCRIPTION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Package: epidatr
22
Type: Package
33
Title: Client for Delphi's 'Epidata' API
4-
Version: 1.0.2
5-
Date: 2023-12-07
4+
Version: 1.1.0
65
Authors@R:
76
c(
87
person("Logan", "Brooks", email = "[email protected]", role = c("aut")),

DEVELOPMENT.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,20 @@ python -m http.server -d docs
4545
Please follow the guidelines in the [PR template document](.github/pull_request_template.md).
4646

4747
## Release process
48+
First, there's a handy function that makes a github issue; for example, at the time of writing we were doing:
49+
```R
50+
usethis::use_release_issue(version = "1.0.2")
51+
```
52+
If you want to extend it, add to the `release_bullets` function in [utils.R](https://github.com/cmu-delphi/epidatr/blob/dev/R/utils.R).
53+
First, make sure that all the checks pass
54+
55+
```R
56+
devtools::check(".", manual = TRUE, env_vars =c(NOT_CRAN = "false"))
57+
```
4858

49-
TBD
59+
Aim for 10/10, no notes. Generally, follow the issue. `revdep_check` is likely to fail but doesn't seem to be terribly important. So for now ignore it.
60+
61+
When this has gone smoothly enough, release to CRAN via
62+
```R
63+
devtools::release(check = TRUE)
64+
```

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ importFrom(openssl,md5)
8181
importFrom(purrr,map_chr)
8282
importFrom(purrr,map_lgl)
8383
importFrom(readr,read_csv)
84+
importFrom(stats,na.omit)
8485
importFrom(tibble,as_tibble)
8586
importFrom(tibble,tibble)
8687
importFrom(utils,help.search)

NEWS.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
# epidatr 1.1.0
22

3+
## Changes
4+
- `pub_covid_hosp_state_timeseries` now supports use of the `as_of` parameter (#209).
5+
- `release_date` and `latest_update` fields are now parsed as `Date`, rather
6+
than as text. This change impacts several endpoints.
7+
- `get_auth_key` renamed to `get_api_key` (#181).
8+
- `get_api_key` no longer reads from R options and only uses environment variables (#217).
9+
- `pvt_twitter` and `pub_wiki` now use `time_type` and `time_values` args instead of mutually exclusive `dates` and `epiweeks` (#236). This matches the interface of the `pub_covidcast` endpoint.
10+
- Updated the default `timeout_seconds` to 15 minutes to allow large queries by default.
11+
## Features
312
- Function reference now displays commonly-used functions first (#205).
13+
- Support `Date` objects passed to version arguments `as_of` and `issues` in
14+
endpoints (#192, #194).
15+
- `clear_cache` now handles positional arguments just like `set_cache` (#197).
16+
- `set_api_key` now available to help persist API key environment variables (#181, #217).
17+
- All endpoints now support the use of "\*" as a wildcard to fetch all dates or epiweeks (#234).
18+
## Patches
419
- Endpoints now fail when passed misspelled arguments (#187, #201).
520
- `pub_fluview_meta` fixed to `fetch` the response automatically.
6-
- `pub_covid_hosp_state_timeseries` now supports use of the `as_of` parameter (#209).
721
- `pub_covid_hosp_state_timeseries` now correctly parses the `issue` field,
822
instead of returning a missing value (#202).
9-
- `release_date` and `latest_update` fields are now parsed as `Date`, rather
10-
than as text. This change impacts several endpoints..
1123
- In `pub_fluview_meta`, `latest_issue` field is now parsed as epiweek, rather
1224
than being parsed as `Date` and returning a missing value.
13-
- Support `Date` objects passed to version arguments `as_of` and `issues` in
14-
endpoints (#192, #194).
1525
- `set_cache` cache size no longer runs into integer overflow (#189).
16-
- `clear_cache` now handles positional arguments just like `set_cache` (#197).
1726
- Improve line-wrapping of warning messages (#191).
18-
- `set_api_key` now available to help persist API key environment variables (#181, #217).
19-
- `get_auth_key` renamed to `get_api_key` (#181).
20-
- `get_api_key` no longer reads from R options and only uses environment variables (#217).
2127
- Fix documentation related to CRAN submission.
2228
- Fix some errors from passing "" as a key.
23-
- `pvt_twitter` and `pub_wiki` now use `time_type` and `time_values` args instead of mutually exclusive `dates` and `epiweeks` (#236). This matches the interface of the `pub_covidcast` endpoint.
24-
- All endpoints now support the use of "\*" as a wildcard to fetch all dates or epiweeks (#234).
2529
- Fixed bug with NAs when parsing ints (#243).
26-
- Updated the default `timeout_seconds` to 15 minutes to allow large queries by default.
2730

2831
# epidatr 1.0.0
2932

R/cache.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ cache_environ$epidatr_cache <- NULL
9090
#' variable is `EPIDATR_CACHE_LOGFILE`.
9191
#' @param confirm whether to confirm directory creation. default is `TRUE`;
9292
#' should only be set in non-interactive scripts
93+
#' @param startup indicates whether the function is being called on
94+
#' startup. Affects suppressability of the messages. Default is `FALSE`.
9395
#' @return [`NULL`] no return value, all effects are stored in the package
9496
#' environment
9597
#' @seealso [`clear_cache`] to delete the old cache while making a new one,
@@ -102,7 +104,8 @@ set_cache <- function(cache_dir = NULL,
102104
days = NULL,
103105
max_size = NULL,
104106
logfile = NULL,
105-
confirm = TRUE) {
107+
confirm = TRUE,
108+
startup = FALSE) {
106109
if (is.null(cache_dir)) {
107110
cache_dir <- Sys.getenv("EPIDATR_CACHE_DIR", unset = rappdirs::user_cache_dir("R", version = "epidatr"))
108111
} else if (is.null(cache_dir)) {
@@ -171,9 +174,10 @@ set_cache <- function(cache_dir = NULL,
171174
cli::cli_inform(c(
172175
"!" = "epidatr cache is being used (set env var EPIDATR_USE_CACHE=FALSE if not intended).",
173176
"i" = "The cache directory is {cache_dir}.",
174-
"i" = "The cache will be cleared after {days} days and will be pruned if it exceeds {max_size} MB.",
177+
"i" = "The cache will be cleared after {days} day{ifelse(days>1,'s','')}
178+
and will be pruned if it exceeds {max_size} MB.",
175179
"i" = "The log of cache transactions is stored at {file.path(cache_dir, logfile)}."
176-
))
180+
), class = if (startup) "packageStartupMessage" else NULL)
177181
}
178182

179183
#' Manually reset the cache, deleting all currently saved data and starting afresh

R/epidatr-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
cache_environ$use_cache <- Sys.getenv("EPIDATR_USE_CACHE", unset = FALSE)
1212
cache_environ$use_cache <- (cache_environ$use_cache == "TRUE")
1313
if (cache_environ$use_cache) {
14-
set_cache()
14+
set_cache(startup = TRUE)
1515
}
1616
}

R/model.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ print.EpidataFieldInfo <- function(x, ...) {
165165
cli::cli_dl(x[attr(x, "names")])
166166
}
167167

168+
#' @importFrom stats na.omit
168169
parse_value <- function(info, value, disable_date_parsing = FALSE) {
169170
stopifnot(inherits(info, "EpidataFieldInfo"))
170171

R/utils.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,9 @@ get_wildcard_equivalent_dates <- function(time_value, time_type = c("day", "week
6161
}
6262
return(time_value)
6363
}
64+
65+
#' inserts each string as a bullet at the end of the "Prepare for release" section
66+
#' @keywords internal
67+
release_bullets <- function() {
68+
c("merge to main")
69+
}

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,6 @@ See also the [Terms of Use](https://delphi.cmu.edu/covidcast/terms-of-use/), not
112112

113113

114114
[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
115-
[mit-url]: https://opensource.org/license/mit/
115+
[mit-url]: https://opensource.org/license/mit
116116
[github-actions-image]: https://github.com/cmu-delphi/epidatr/workflows/ci/badge.svg
117117
[github-actions-url]: https://github.com/cmu-delphi/epidatr/actions

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<!-- badges: start -->
77

88
[![License:
9-
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit/)
9+
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/license/mit)
1010
[![Github
1111
Actions](https://github.com/cmu-delphi/epidatr/workflows/ci/badge.svg)](https://github.com/cmu-delphi/epidatr/actions)
1212
[![codecov](https://codecov.io/gh/dsweber2/epidatr/branch/dev/graph/badge.svg?token=jVHL9eHZNZ)](https://app.codecov.io/gh/dsweber2/epidatr)
@@ -39,6 +39,13 @@ also provide packages for downstream data processing
3939

4040
``` r
4141
library(epidatr)
42+
#> ! epidatr cache is being used (set env var EPIDATR_USE_CACHE=FALSE if not
43+
#> intended).
44+
#> ℹ The cache directory is /fasterHome/workingDataDir/epidatr.
45+
#> ℹ The cache will be cleared after 1 day and will be pruned if it exceeds 1024
46+
#> MB.
47+
#> ℹ The log of cache transactions is stored at
48+
#> /fasterHome/workingDataDir/epidatr/logfile.txt.
4249
# Obtain the smoothed covid-like illness (CLI) signal from Delphi's US COVID-19
4350
# Trends and Impact Survey (CTIS), in partnership with Facebook, as it was on
4451
# April 10, 2021 for the US at the national level

man/clear_cache.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/release_bullets.Rd

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/set_cache.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)