Skip to content
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Suggests:
Kendall,
knitr,
rmarkdown,
sf,
testthat (>= 3.0.0),
tidyterra,
withr,
Expand All @@ -44,7 +45,6 @@ Imports:
jsonlite,
rappdirs,
rlang,
sf,
stringr,
terra,
tibble
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ export(cd_stac_catalog)
export(cd_summary)
export(cd_trend)
export(cd_variables)
importFrom(rlang,.data)
importFrom(rlang,.env)
1 change: 1 addition & 0 deletions R/cd-package.R
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#' @keywords internal
#' @importFrom rlang .data .env
"_PACKAGE"
3 changes: 3 additions & 0 deletions tests/testthat/test-cd_crop.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("cd_crop returns cropped SpatRaster from sf AOI", {
skip_if_not_installed("sf")
href <- system.file("extdata", "example_climate.tif", package = "cd")
aoi <- sf::st_read(
system.file("extdata", "example_aoi.gpkg", package = "cd"),
Expand All @@ -23,6 +24,7 @@ test_that("cd_crop accepts SpatVector AOI", {
})

test_that("cd_crop preserves band names", {
skip_if_not_installed("sf")
href <- system.file("extdata", "example_climate.tif", package = "cd")
aoi <- sf::st_read(
system.file("extdata", "example_aoi.gpkg", package = "cd"),
Expand All @@ -34,6 +36,7 @@ test_that("cd_crop preserves band names", {
})

test_that("cd_crop with cache = TRUE passes a local href straight through", {
skip_if_not_installed("sf")
href <- system.file("extdata", "example_climate.tif", package = "cd")
aoi <- sf::st_read(
system.file("extdata", "example_aoi.gpkg", package = "cd"),
Expand Down
5 changes: 5 additions & 0 deletions tests/testthat/test-cd_extract.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("cd_extract returns expected structure", {
skip_if_not_installed("sf")
catalog <- cd_catalog(
system.file("extdata", "example_catalog.json", package = "cd")
)
Expand All @@ -17,6 +18,7 @@ test_that("cd_extract returns expected structure", {
})

test_that("cd_extract values are numeric and non-NA", {
skip_if_not_installed("sf")
catalog <- cd_catalog(
system.file("extdata", "example_catalog.json", package = "cd")
)
Expand All @@ -31,6 +33,7 @@ test_that("cd_extract values are numeric and non-NA", {
})

test_that("cd_extract filters by years", {
skip_if_not_installed("sf")
catalog <- cd_catalog(
system.file("extdata", "example_catalog.json", package = "cd")
)
Expand All @@ -45,6 +48,7 @@ test_that("cd_extract filters by years", {
})

test_that("cd_extract cache = TRUE matches cache = FALSE for local COGs", {
skip_if_not_installed("sf")
catalog <- cd_catalog(
system.file("extdata", "example_catalog.json", package = "cd")
)
Expand All @@ -59,6 +63,7 @@ test_that("cd_extract cache = TRUE matches cache = FALSE for local COGs", {
})

test_that("cd_extract filters by variables", {
skip_if_not_installed("sf")
catalog <- cd_catalog(
system.file("extdata", "example_catalog.json", package = "cd")
)
Expand Down
Loading