Skip to content

Post 1.0 release #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
^README\.Rmd$
^CRAN-SUBMISSION$
^LICENSE\.md$
^revdep$
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Please:

- [ ] Make sure this PR is against "dev", not "main" (unless this is a release
PR).
- [ ] Request a review from one of the current epiprocess main reviewers:
brookslogan, nmdefries.
- [ ] Request a review from one of the current epidatr main reviewers:
brookslogan, dshemetov, nmdefries, dsweber2.
- [ ] Makes sure to bump the version number in `DESCRIPTION`. Always increment
the patch version number (the third number), unless you are making a
release PR from dev to main, in which case increment the minor version
Expand Down
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Package: epidatr
Type: Package
Title: Client for Delphi's 'Epidata' API
Version: 1.0.2
Date: 2023-12-07
Version: 1.1.0
Authors@R:
c(
person("Logan", "Brooks", email = "[email protected]", role = c("aut")),
Expand Down
17 changes: 16 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,20 @@ python -m http.server -d docs
Please follow the guidelines in the [PR template document](.github/pull_request_template.md).

## Release process
First, there's a handy function that makes a github issue; for example, at the time of writing we were doing:
```R
usethis::use_release_issue(version = "1.0.2")
```
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).
First, make sure that all the checks pass

```R
devtools::check(".", manual = TRUE, env_vars =c(NOT_CRAN = "false"))
```

TBD
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.

When this has gone smoothly enough, release to CRAN via
```R
devtools::release(check = TRUE)
```
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ importFrom(openssl,md5)
importFrom(purrr,map_chr)
importFrom(purrr,map_lgl)
importFrom(readr,read_csv)
importFrom(stats,na.omit)
importFrom(tibble,as_tibble)
importFrom(tibble,tibble)
importFrom(utils,help.search)
Expand Down
27 changes: 15 additions & 12 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
# epidatr 1.1.0

## Changes
- `pub_covid_hosp_state_timeseries` now supports use of the `as_of` parameter (#209).
- `release_date` and `latest_update` fields are now parsed as `Date`, rather
than as text. This change impacts several endpoints.
- `get_auth_key` renamed to `get_api_key` (#181).
- `get_api_key` no longer reads from R options and only uses environment variables (#217).
- `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.
- Updated the default `timeout_seconds` to 15 minutes to allow large queries by default.
## Features
- Function reference now displays commonly-used functions first (#205).
- Support `Date` objects passed to version arguments `as_of` and `issues` in
endpoints (#192, #194).
- `clear_cache` now handles positional arguments just like `set_cache` (#197).
- `set_api_key` now available to help persist API key environment variables (#181, #217).
- All endpoints now support the use of "\*" as a wildcard to fetch all dates or epiweeks (#234).
## Patches
- Endpoints now fail when passed misspelled arguments (#187, #201).
- `pub_fluview_meta` fixed to `fetch` the response automatically.
- `pub_covid_hosp_state_timeseries` now supports use of the `as_of` parameter (#209).
- `pub_covid_hosp_state_timeseries` now correctly parses the `issue` field,
instead of returning a missing value (#202).
- `release_date` and `latest_update` fields are now parsed as `Date`, rather
than as text. This change impacts several endpoints..
- In `pub_fluview_meta`, `latest_issue` field is now parsed as epiweek, rather
than being parsed as `Date` and returning a missing value.
- Support `Date` objects passed to version arguments `as_of` and `issues` in
endpoints (#192, #194).
- `set_cache` cache size no longer runs into integer overflow (#189).
- `clear_cache` now handles positional arguments just like `set_cache` (#197).
- Improve line-wrapping of warning messages (#191).
- `set_api_key` now available to help persist API key environment variables (#181, #217).
- `get_auth_key` renamed to `get_api_key` (#181).
- `get_api_key` no longer reads from R options and only uses environment variables (#217).
- Fix documentation related to CRAN submission.
- Fix some errors from passing "" as a key.
- `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.
- All endpoints now support the use of "\*" as a wildcard to fetch all dates or epiweeks (#234).
- Fixed bug with NAs when parsing ints (#243).
- Updated the default `timeout_seconds` to 15 minutes to allow large queries by default.

# epidatr 1.0.0

Expand Down
10 changes: 7 additions & 3 deletions R/cache.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ cache_environ$epidatr_cache <- NULL
#' variable is `EPIDATR_CACHE_LOGFILE`.
#' @param confirm whether to confirm directory creation. default is `TRUE`;
#' should only be set in non-interactive scripts
#' @param startup indicates whether the function is being called on
#' startup. Affects suppressability of the messages. Default is `FALSE`.
#' @return [`NULL`] no return value, all effects are stored in the package
#' environment
#' @seealso [`clear_cache`] to delete the old cache while making a new one,
Expand All @@ -102,7 +104,8 @@ set_cache <- function(cache_dir = NULL,
days = NULL,
max_size = NULL,
logfile = NULL,
confirm = TRUE) {
confirm = TRUE,
startup = FALSE) {
if (is.null(cache_dir)) {
cache_dir <- Sys.getenv("EPIDATR_CACHE_DIR", unset = rappdirs::user_cache_dir("R", version = "epidatr"))
} else if (is.null(cache_dir)) {
Expand Down Expand Up @@ -171,9 +174,10 @@ set_cache <- function(cache_dir = NULL,
cli::cli_inform(c(
"!" = "epidatr cache is being used (set env var EPIDATR_USE_CACHE=FALSE if not intended).",
"i" = "The cache directory is {cache_dir}.",
"i" = "The cache will be cleared after {days} days and will be pruned if it exceeds {max_size} MB.",
"i" = "The cache will be cleared after {days} day{ifelse(days>1,'s','')}
and will be pruned if it exceeds {max_size} MB.",
"i" = "The log of cache transactions is stored at {file.path(cache_dir, logfile)}."
))
), class = if (startup) "packageStartupMessage" else NULL)
}

#' Manually reset the cache, deleting all currently saved data and starting afresh
Expand Down
2 changes: 1 addition & 1 deletion R/epidatr-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
cache_environ$use_cache <- Sys.getenv("EPIDATR_USE_CACHE", unset = FALSE)
cache_environ$use_cache <- (cache_environ$use_cache == "TRUE")
if (cache_environ$use_cache) {
set_cache()
set_cache(startup = TRUE)
}
}
1 change: 1 addition & 0 deletions R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ print.EpidataFieldInfo <- function(x, ...) {
cli::cli_dl(x[attr(x, "names")])
}

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

Expand Down
6 changes: 6 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ get_wildcard_equivalent_dates <- function(time_value, time_type = c("day", "week
}
return(time_value)
}

#' inserts each string as a bullet at the end of the "Prepare for release" section
#' @keywords internal
release_bullets <- function() {
c("merge to main")
}
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ See also the [Terms of Use](https://delphi.cmu.edu/covidcast/terms-of-use/), not


[mit-image]: https://img.shields.io/badge/License-MIT-yellow.svg
[mit-url]: https://opensource.org/license/mit/
[mit-url]: https://opensource.org/license/mit
[github-actions-image]: https://github.com/cmu-delphi/epidatr/workflows/ci/badge.svg
[github-actions-url]: https://github.com/cmu-delphi/epidatr/actions
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- badges: start -->

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

``` r
library(epidatr)
#> ! epidatr cache is being used (set env var EPIDATR_USE_CACHE=FALSE if not
#> intended).
#> ℹ The cache directory is /fasterHome/workingDataDir/epidatr.
#> ℹ The cache will be cleared after 1 day and will be pruned if it exceeds 1024
#> MB.
#> ℹ The log of cache transactions is stored at
#> /fasterHome/workingDataDir/epidatr/logfile.txt.
# Obtain the smoothed covid-like illness (CLI) signal from Delphi's US COVID-19
# Trends and Impact Survey (CTIS), in partnership with Facebook, as it was on
# April 10, 2021 for the US at the national level
Expand Down
2 changes: 2 additions & 0 deletions man/clear_cache.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions man/release_bullets.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion man/set_cache.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.