diff --git a/.Rbuildignore b/.Rbuildignore index d79d3e82545358eb4f0d2d60205fabcd8eb6014a..698f5e2cc314e9d59694eef5f2c6f7fc309cd23b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,7 +9,7 @@ ^inst/doc$ ^\.gitlab-ci\.yml$ ## unit tests should be ignored when building the package for CRAN -^tests$ +#^tests$ ^inst/PlotProfiling\.R$ ^.gitlab$ # Suggested by http://r-pkgs.had.co.nz/package.html diff --git a/DESCRIPTION b/DESCRIPTION index 83303e670f70813e68b96ab62cff23e1b509bf75..72a814e0064fb165b672af39a3df2084ce0af18a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -32,7 +32,6 @@ Imports: easyNCDF, s2dv, ClimProjDiags, - PCICt, stringr, methods Suggests: diff --git a/NAMESPACE b/NAMESPACE index a0578085731917b06b9327dbf575eca03c9a3fa5..1b77681ceb3855133d2e0bce57dd95b801a208d7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -16,7 +16,7 @@ export(Start) export(Step) export(indices) export(values) -import(PCICt) +import(ClimProjDiags) import(abind) import(bigmemory) import(easyNCDF) diff --git a/R/NcDataReader.R b/R/NcDataReader.R index 47817c65e54684380670ab35b2bd928268afce62..66d58fd77077243b9c8e817623a74d5689232b9a 100644 --- a/R/NcDataReader.R +++ b/R/NcDataReader.R @@ -43,8 +43,9 @@ #' first_round_indices, synonims) #'@seealso \code{\link{NcOpener}} \code{\link{NcDimReader}} #' \code{\link{NcCloser}} \code{\link{NcVarReader}} -#'@import easyNCDF PCICt +#'@import easyNCDF ClimProjDiags #'@export + NcDataReader <- function(file_path = NULL, file_object = NULL, file_selectors = NULL, inner_indices = NULL, synonims) { @@ -303,8 +304,8 @@ NcDataReader <- function(file_path = NULL, file_object = NULL, result_vec[result_i] <- tmp } # Transfer the strings to time class - new_array <- PCICt::as.PCICt(result_vec, cal = 'gregorian') - new_array <- suppressWarnings(PCICt::as.POSIXct.PCICt(new_array, tz = "UTC")) + new_array <- ClimProjDiags::as.PCICt(result_vec, cal = 'gregorian') + new_array <- suppressWarnings(ClimProjDiags::as.POSIXct.PCICt(new_array, tz = "UTC")) # if (calendar == 'gregorian') { # # Find how many years + months @@ -373,8 +374,8 @@ NcDataReader <- function(file_path = NULL, file_object = NULL, } if (!(units %in% c('month', 'months') & calendar == 'gregorian')) { - new_array <- PCICt::as.PCICt(result, cal = calendar, origin = parts[2])[] - new_array <- suppressWarnings(PCICt::as.POSIXct.PCICt(new_array, tz = "UTC")) + new_array <- ClimProjDiags::as.PCICt(result, cal = calendar, origin = parts[2])[] + new_array <- suppressWarnings(ClimProjDiags::as.POSIXct.PCICt(new_array, tz = "UTC")) } #new_array <- seq(as.POSIXct(parts[2]), # length = max(result, na.rm = TRUE) + 1, diff --git a/R/Utils.R b/R/Utils.R index af1cd079a16fd4839d953e3b1f35cc880265f6a0..56a5e54e6c09702765ce89021c6359c2895b7015 100644 --- a/R/Utils.R +++ b/R/Utils.R @@ -885,6 +885,7 @@ write_autosubmit_bash <- function(chunks, cluster, autosubmit_suite_dir) { chunk_args[2, ] <- paste0('%JOBS.CHUNK_', n_chunk, '.', chunk_names, '_N%') chunk_args <- paste0('(', paste(c(chunk_args), collapse = ' '), ')') + bash_script_template <- file(system.file('chunking/Autosubmit/startR_autosubmit.sh', package = 'startR')) bash_script_lines <- readLines(bash_script_template) diff --git a/tests/testthat/test-Start-calendar.R b/tests/testthat/test-Start-calendar.R index 43651ab4fcad07f3ff65aed2bb4954f706a7e951..0ba03c84c7f714d28b2f14864e5e9e41d7cf1859 100644 --- a/tests/testthat/test-Start-calendar.R +++ b/tests/testthat/test-Start-calendar.R @@ -243,8 +243,11 @@ expect_equal( dim(attr(data_obs, 'Variables')$common$time), c(date = 4, time = 1) ) + +## NOTE: as.character() behavior changes in R/4.?.?, midnight dates become YYYYmmdd without +## the hour information. This is why the unit test fails in the hub. expect_equal( -as.character(attr(data_obs, 'Variables')$common$time), +format(attr(data_obs, 'Variables')$common$time), c("1960-11-16 00:00:00", "1960-12-16 12:00:00", "1961-01-16 12:00:00", "1961-02-15 00:00:00") )