Skip to content

Commit 3a1ef72

Browse files
authored
Merge pull request #217 from aloftdata/main
update with main
2 parents f2321a9 + 6fd2d91 commit 3a1ef72

6 files changed

Lines changed: 18 additions & 7 deletions

File tree

.github/workflows/R-CMD-check.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ jobs:
2626
- {os: ubuntu-latest, r: 'release'}
2727
- {os: ubuntu-latest, r: 'oldrel-1'}
2828
# And minimum supported version in DESCRIPTION
29-
- {os: ubuntu-latest, r: '4.1.0'}
29+
# this seems to be failing due to a issue installing rhdf5 from bioconductor
30+
# - {os: ubuntu-latest, r: '4.1.0'}
3031

3132
env:
3233
getRad_nl_api_key: ${{ secrets.GETRAD_NL_API_KEY }}

R/get_pvol_nl.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ get_pvol_nl <- function(radar, time, ..., call = rlang::caller_env()) {
6767
"There was an authorization error. You may have used an invalid API
6868
key.",
6969
"i" = "Please check if you set the correct {.val nl_api_key} with
70-
{.code get_secret(\"nl_api_key\")}."
70+
{.run [get_secret(\"nl_api_key\")](getRad::get_secret(\"nl_api_key\"))}."
7171
),
7272
cnd = cnd,
7373
class = "getRad_error_get_pvol_nl_authorization_failure",
@@ -80,7 +80,7 @@ get_pvol_nl <- function(radar, time, ..., call = rlang::caller_env()) {
8080
"There was a rate limitation error (HTTP 429) while getting data from the Netherlands.",
8181
"i" = "This frequently occurs when using the anonymous key, if it occurs repeatedly consider requesting a registered key ({.url https://developer.dataplatform.knmi.nl/open-data-api#token}). ",
8282
"i" = "You can check the current value of {.val nl_api_key} with
83-
{.code get_secret(\"nl_api_key\")}."
83+
{.run [get_secret(\"nl_api_key\")](getrad::get_secret(\"nl_api_key\"))}."
8484
),
8585
cnd = cnd,
8686
class = "getRad_error_get_pvol_nl_429_failure",

R/secrets.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ get_secret <- function(name) {
7979
cli::cli_abort(
8080
c(
8181
"Can't find secret {.arg {sname}} in the keyring.",
82-
"i" = "Please use {.code set_secret(\"{name}\")} to store the secret. Note that the prefix is automatically added in {.fun set_secret}."
82+
"i" = "Please use {.run [set_secret(\"{name}\")](getRad::set_secret(\"{name}\"))} to store the secret. Note that the prefix is automatically added in {.fun set_secret}."
8383
),
8484
class = "getRad_error_secret_not_found"
8585
)

tests/testthat/test-get_pvol.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ test_that("multiple timestamps and radars work", {
130130

131131
test_that("Mixed radar vector (single timestamp)", {
132132
skip_if_offline()
133+
skip_if_not_installed("vol2birdR", "1.3.0")
133134
time_utc <- lubridate::as_datetime("2021-01-20 05:01:00")
134135
suppressMessages(pvols <- getRad::get_pvol(c("KABR", "finur"), time_utc))
135136
expect_true(is.list(pvols))
@@ -152,6 +153,8 @@ test_that("Mixed radar vector (single timestamp)", {
152153

153154
test_that("Mixed radar vector + 9 minute interval", {
154155
skip_if_offline()
156+
skip_if_not_installed("vol2birdR", "1.3.0")
157+
155158
time_utc <- lubridate::as_datetime("2025-01-20 03:55:50")
156159
dt_int <- lubridate::interval(time_utc, time_utc + lubridate::minutes(9))
157160
suppressMessages(pvols <- getRad::get_pvol(c("KABR", "fikan"), dt_int))

tests/testthat/test-get_pvol_at.R

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test_that("Pvol for hochficht in austria can be downloaded", {
2-
skip_if_offline("public.hub.geosphere.at")
2+
skip_if_offline(host = "public.hub.geosphere.at")
33
time <- as.POSIXct(Sys.time() - 10000, tz = "Europe/Helsinki")
44
pvol <- expect_s3_class(get_pvol("hochficht", time, param = "all"), "pvol")
55
expect_true(bioRad::is.pvol(pvol))
@@ -10,7 +10,7 @@ test_that("Pvol for hochficht in austria can be downloaded", {
1010
})
1111

1212
test_that("Pvol for hochficht in austria can be downloaded", {
13-
skip_if_offline("public.hub.geosphere.at")
13+
skip_if_offline(host = "public.hub.geosphere.at")
1414
time <- as.POSIXct(
1515
Sys.time() - 10000 - 24 * 3 * 60 * 60,
1616
tz = "Europe/Helsinki"
@@ -21,7 +21,10 @@ test_that("Pvol for hochficht in austria can be downloaded", {
2121
)
2222
})
2323
test_that("hochficht can be combined with other radars", {
24-
skip_if_offline("public.hub.geosphere.at")
24+
skip_if_offline(host = "public.hub.geosphere.at")
25+
skip_if_offline(host = "unidata-nexrad-level2.s3.amazonaws.com")
26+
skip_if_offline(host = "opendata.dwd.de")
27+
skip_if_not_installed("vol2birdR", "1.3.0")
2528
suppressMessages(expect_type(
2629
pvol_lst <- get_pvol(
2730
c("depro", "hochficht", "KABX"),

tests/testthat/test-get_pvol_us.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ dt_int <- lubridate::interval(time_utc, time_utc + lubridate::minutes(9))
33

44
test_that("NEXRAD polar volume can be downloaded", {
55
skip_if_offline(host = "unidata-nexrad-level2.s3.amazonaws.com")
6+
skip_if_not_installed("vol2birdR", "1.3.0")
7+
68
suppressMessages(
79
expect_s3_class(
810
getRad::get_pvol("KABR", time_utc),
@@ -24,6 +26,8 @@ test_that("pvol us internal functions", {
2426

2527
test_that("NEXRAD polar volume correct time is downloaded", {
2628
skip_if_offline(host = "unidata-nexrad-level2.s3.amazonaws.com")
29+
skip_if_not_installed("vol2birdR", "1.3.0")
30+
2731
t <- as.POSIXct("2025-1-10 18:00:00", tz = "UTC")
2832
suppressMessages(expect_identical(
2933
getRad::get_pvol("KABX", t)$datetime,

0 commit comments

Comments
 (0)