From 376749deed58305aadff19a0f219fc5abee320b5 Mon Sep 17 00:00:00 2001 From: aho Date: Tue, 6 Sep 2022 12:01:13 +0200 Subject: [PATCH 1/3] Run tests by CICD --- .Rbuildignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index 2814b11..67f31a7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,7 +10,7 @@ README\.md$ vignettes .gitlab-ci.yml # unit tests should be ignored when building the package for CRAN -^tests$ +#^tests$ # CDO is not in windbuilder, so we can test the unit tests by winbuilder # but test-CDORemap.R needs to be hidden #tests/testthat/test-CDORemap.R -- GitLab From b1e37dc4dc0d2a93d672da93b88df7accdca403f Mon Sep 17 00:00:00 2001 From: aho Date: Tue, 6 Sep 2022 15:01:28 +0200 Subject: [PATCH 2/3] Add bigmemory:: to describe() to avoid overwritten by testthat::describe --- R/Load.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/Load.R b/R/Load.R index e188299..c5d4111 100644 --- a/R/Load.R +++ b/R/Load.R @@ -1866,12 +1866,12 @@ Load <- function(var, exp = NULL, obs = NULL, sdates, nmember = NULL, if (!is.null(dim_exp) && (length(unlist(dim_exp)) == length(dim_exp)) && !anyNA(unlist(dim_exp)) && !any(unlist(dim_exp) == 0)) { var_exp <- big.matrix(nrow = prod(unlist(dim_exp)), ncol = 1) - pointer_var_exp <- describe(var_exp) + pointer_var_exp <- bigmemory::describe(var_exp) } if (!is.null(dim_obs) && (length(unlist(dim_obs)) == length(dim_obs)) && !anyNA(unlist(dim_obs)) && !any(unlist(dim_obs) == 0)) { var_obs <- big.matrix(nrow = prod(unlist(dim_obs)), ncol = 1) - pointer_var_obs <- describe(var_obs) + pointer_var_obs <- bigmemory::describe(var_obs) } if (is.null(nprocs)) { nprocs <- detectCores() -- GitLab From c8831856f732e703237bd013fffdff29f2bfe319 Mon Sep 17 00:00:00 2001 From: aho Date: Tue, 6 Sep 2022 15:48:47 +0200 Subject: [PATCH 3/3] Improve condition statement --- R/Load.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/Load.R b/R/Load.R index c5d4111..cca99bf 100644 --- a/R/Load.R +++ b/R/Load.R @@ -1545,7 +1545,7 @@ Load <- function(var, exp = NULL, obs = NULL, sdates, nmember = NULL, # If there are no experiments to load we need to choose a number of time steps # to load from observational datasets. We load from the first start date to # the current date. - if (is.null(exp) || dims == 0) { + if (is.null(exp) || identical(dims, 0)) { if (is.null(leadtimemax)) { diff <- Sys.time() - as.POSIXct(sdates[1], format = '%Y%m%d', tz = "UTC") if (diff > 0) { -- GitLab