Skip to content

Commit

Permalink
Finish testthat tests for three new functions, updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylweiss committed Jul 17, 2024
1 parent 356cff0 commit faad5ec
Show file tree
Hide file tree
Showing 17 changed files with 129 additions and 55 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export(az_daily)
export(az_heat)
export(az_hourly)
export(az_lw15min)
export(az_lwdaily)
importFrom(magrittr,"%>%")
importFrom(rlang,.data)
4 changes: 2 additions & 2 deletions R/az_15min.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
#' Defaults to the current date and time if left blank and `start_date_time`
#' is specified.
#' @details If neither `start_date_time` nor `end_date_time` are supplied, the
#' most recent date-time of data will be returned. If only `start_date_time`
#' most recent datetime of data will be returned. If only `start_date_time`
#' is supplied, then `end_date_time` defaults to the current time. Supplying
#' only `end_date_time` will result in an error.
#' @note If `station_id` is supplied as a vector, multiple successive calls to
#' the API will be made. You may find better performance getting data for all
#' the stations by leaving `station_id` blank and subsetting the resulting
#' dataframe. Only the most recent 48 hours of 15-minute data are stored in
#' the AZMet API.
#' @return a tibble. For units and other metadata, see
#' @return A tibble. For units and other metadata, see
#' <https://azmet.arizona.edu/about>
#' @seealso [az_daily()], [az_heat()], [az_hourly()], [az_lw15min()], [az_lwdaily()]
#' @source <https://azmet.arizona.edu/>
Expand Down
4 changes: 2 additions & 2 deletions R/az_add_units.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#' Assigns correct units to the output of `az_hourly()`, `az_daily()`, and
#' `az_heat()` using the `units` package.
#'
#' @param x a tibble output by [az_hourly()], [az_daily()], or [az_heat()]
#' @param x A tibble output by [az_hourly()], [az_daily()], or [az_heat()]
#'
#' @return a tibble with columns of class "units"
#' @return A tibble with columns of class "units"
#' @export
#'
#' @examples
Expand Down
2 changes: 1 addition & 1 deletion R/az_daily.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' the stations by leaving `station_id` blank and subsetting the resulting
#' dataframe. Requests for data from all stations for more than 6-12 months
#' may take considerable time.
#' @return a tibble. For units and other metadata, see
#' @return A tibble. For units and other metadata, see
#' <https://azmet.arizona.edu/about>
#' @seealso [az_15min()], [az_heat()], [az_hourly()], [az_lw15min()], [az_lwdaily()]
#' @source <https://azmet.arizona.edu/>
Expand Down
2 changes: 1 addition & 1 deletion R/az_heat.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' the API will be made. You may find better performance getting data for all
#' the stations by leaving `station_id` blank and subsetting the resulting
#' dataframe.
#' @return a tibble. For units and other metadata, see
#' @return A tibble. For units and other metadata, see
#' <https://azmet.arizona.edu/about>
#' @seealso [az_15min()], [az_daily()], [az_hourly()], [az_lw15min()], [az_lwdaily()]
#' @source <https://azmet.arizona.edu/>
Expand Down
2 changes: 1 addition & 1 deletion R/az_hourly.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#' the stations by leaving `station_id` blank and subsetting the resulting
#' dataframe. Requests for data from all stations for more than 10-15 days may
#' take considerable time.
#' @return a tibble. For units and other metadata, see
#' @return A tibble. For units and other metadata, see
#' <https://azmet.arizona.edu/about>
#' @seealso [az_15min()], [az_daily()], [az_heat()], [az_lw15min()], [az_lwdaily()]
#' @source <https://azmet.arizona.edu/>
Expand Down
4 changes: 2 additions & 2 deletions R/az_lw15min.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
#' Defaults to the current date and time if left blank and `start_date_time`
#' is specified.
#' @details If neither `start_date_time` nor `end_date_time` are supplied, the
#' most recent date-time of data will be returned. If only `start_date_time`
#' most recent datetime of data will be returned. If only `start_date_time`
#' is supplied, then `end_date_time` defaults to the current time. Supplying
#' only `end_date_time` will result in an error.
#' @note If `station_id` is supplied as a vector, multiple successive calls to
#' the API will be made. You may find better performance getting data for all
#' the stations by leaving `station_id` blank and subsetting the resulting
#' dataframe. Only the most recent 48 hours of 15-minute data are stored in
#' the AZMet API.
#' @return a tibble. For units and other metadata, see
#' @return A tibble. For units and other metadata, see
#' <https://azmet.arizona.edu/about>
#' @seealso [az_15min()], [az_daily()], [az_heat()], [az_hourly()], [az_lwdaily()]
#' @source <https://azmet.arizona.edu/>
Expand Down
2 changes: 1 addition & 1 deletion R/az_lwdaily.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' the stations by leaving `station_id` blank and subsetting the resulting
#' dataframe. Requests for data from all stations for more than 6-12 months
#' may take considerable time.
#' @return a tibble. For units and other metadata, see
#' @return A tibble. For units and other metadata, see
#' <https://azmet.arizona.edu/about>
#' @seealso [az_15min()], [az_daily()], [az_heat()], [az_hourly()], [az_lw15min()]
#' @source <https://azmet.arizona.edu/>
Expand Down
9 changes: 5 additions & 4 deletions man/az_15min.Rd

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

4 changes: 2 additions & 2 deletions man/az_add_units.Rd

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

33 changes: 18 additions & 15 deletions man/az_daily.Rd

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

13 changes: 7 additions & 6 deletions man/az_heat.Rd

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

13 changes: 7 additions & 6 deletions man/az_hourly.Rd

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

11 changes: 6 additions & 5 deletions man/az_lw15min.Rd

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

67 changes: 67 additions & 0 deletions man/az_lwdaily.Rd

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

3 changes: 1 addition & 2 deletions tests/testthat/test-az_hourly.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test_that("start=NULL, end=NULL works as expected", {
az_hourly(
station_id = "az01"
)
}, glue::glue("Querying most recent hour of data"))
}, glue::glue("Querying most recent hour of data ..."))

expect_equal(nrow(null_null), 1)
#could be that current hour hasn't hit API yet.
Expand Down Expand Up @@ -101,4 +101,3 @@ test_that("start as date only is rounded correctly", {
)
expect_equal(min(date_null$date_datetime), start_actual)
})

Loading

0 comments on commit faad5ec

Please sign in to comment.