Skip to content

Commit

Permalink
style with {styler}
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed Dec 17, 2024
1 parent 67b06b8 commit a7a97f8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 16 deletions.
8 changes: 5 additions & 3 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ manage_cache <- NULL # nocov start
utils::globalVariables(c("."))

x <- hoardr::hoard()
x$cache_path_set(path = "getCRUCLdata",
prefix = "org.R-project.R/R",
type = "user_cache_dir")
x$cache_path_set(
path = "getCRUCLdata",
prefix = "org.R-project.R/R",
type = "user_cache_dir"
)
manage_cache <<- x
}
}
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
"applicationCategory": "Tools",
"isPartOf": "https://ropensci.org",
"keywords": ["anglia-cru", "climate-data", "cru-cl2", "temperature", "rainfall", "elevation", "data-access", "wind", "relative-humidity", "solar-radiation", "diurnal-temperature", "frost", "cru", "r", "rstats", "r-package", "peer-reviewed"],
"fileSize": "920.313KB",
"fileSize": "920.18KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
11 changes: 5 additions & 6 deletions tests/testthat/test-get_CRU.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ test_that("get_CRU will retrieve only precipitation file when pre_cv TRUE", {
))

skip_if_offline()

.get_CRU(
pre = FALSE,
pre_cv = TRUE,
Expand Down Expand Up @@ -36,7 +36,7 @@ test_that("get_CRU will retrieve only precipitation file when pre_cv TRUE", {

test_that("get_CRU will retrieve diurnal tmp range & tmp files when tmn TRUE", {
skip_if_offline()

.get_CRU(
pre = FALSE,
pre_cv = FALSE,
Expand Down Expand Up @@ -64,7 +64,7 @@ test_that("get_CRU will retrieve diurnal tmp range & tmp files when tmn TRUE", {
# Test that get_CRU will retrieve diurnal tmp & tmp files when tmx TRUE --------
test_that("get_CRU will retrieve diurnal tmp range & tmp files when tmx TRUE", {
skip_if_offline()

unlink(list.files(
path = tempdir(),
pattern = ".dat.gz$",
Expand Down Expand Up @@ -99,7 +99,7 @@ test_that("get_CRU will retrieve diurnal tmp range & tmp files when tmx TRUE", {

test_that("get_CRU will set pre to TRUE if pre_cv is TRUE and pre is FALSE", {
skip_if_offline()


pre <- FALSE
pre_cv <- TRUE
Expand All @@ -117,9 +117,8 @@ test_that("get_CRU will set pre to TRUE if pre_cv is TRUE and pre is FALSE", {

test_that("get_CRU will set tmp and dtr to TRUE if tmn or tmx
is TRUE and either/both are false", {
skip_if_offline()

skip_if_offline()

tmp <- FALSE
dtr <- FALSE
tmn <- TRUE
Expand Down
16 changes: 10 additions & 6 deletions tests/testthat/test_caching.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ test_that("test that set_cache creates a cache directory if none exists", {
withr::local_envvar(R_USER_CACHE_DIR = tempdir())
temp_cache <- file.path(tempdir(), "R/getCRUCLdata/")
manage_cache <- hoardr::hoard()
manage_cache$cache_path_set(path = "getCRUCLdata",
prefix = "org.R-project.R/R",
type = "user_cache_dir")
manage_cache$cache_path_set(
path = "getCRUCLdata",
prefix = "org.R-project.R/R",
type = "user_cache_dir"
)
cache <- TRUE
.set_cache(cache)
expect_true(file.exists(manage_cache$cache_path_get()))
Expand Down Expand Up @@ -38,9 +40,11 @@ test_that("caching utils list files in cache and delete when asked", {
withr::local_envvar(R_USER_CACHE_DIR = tempdir())
temp_cache <- file.path(tempdir(), "R/getCRUCLdata/")
manage_cache <- hoardr::hoard()
manage_cache$cache_path_set(path = "getCRUCLdata",
prefix = "org.R-project.R/R",
type = "user_cache_dir")
manage_cache$cache_path_set(
path = "getCRUCLdata",
prefix = "org.R-project.R/R",
type = "user_cache_dir"
)
cache <- TRUE
cache_dir <- .set_cache(cache)
f <-
Expand Down

0 comments on commit a7a97f8

Please sign in to comment.