From 963f6e03460ac96f2753d964a09904c08986fb7b Mon Sep 17 00:00:00 2001 From: aho Date: Mon, 20 Mar 2023 16:33:14 +0100 Subject: [PATCH 1/3] Add conf.lev back to avoid backward incompatibility --- R/Corr.R | 11 +++++++++-- man/Corr.Rd | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/R/Corr.R b/R/Corr.R index c95b103..3430647 100644 --- a/R/Corr.R +++ b/R/Corr.R @@ -46,7 +46,8 @@ #' significance of the test Ho: Corr = 0 based on 'alpha'. The default value is #' FALSE. #'@param alpha A numeric indicating the significance level for the statistical -#' significance test. The default value is 0.05. +#' significance test. The default value is 0.05. +#'@param conf.lev Deprecated. Use alpha now instead. alpha = 1 - conf.lev. #'@param ncores An integer indicating the number of cores to use for parallel #' computation. The default value is NULL. #' @@ -107,7 +108,7 @@ Corr <- function(exp, obs, time_dim = 'sdate', dat_dim = 'dataset', comp_dim = NULL, limits = NULL, method = 'pearson', memb_dim = NULL, memb = TRUE, pval = TRUE, conf = TRUE, sign = FALSE, - alpha = 0.05, ncores = NULL) { + alpha = 0.05, conf.lev = NULL, ncores = NULL) { # Check inputs ## exp and obs (1) @@ -195,6 +196,12 @@ Corr <- function(exp, obs, time_dim = 'sdate', dat_dim = 'dataset', if (!is.logical(sign) | length(sign) > 1) { stop("Parameter 'sign' must be one logical value.") } + ## conf.lev + ##NOTE: remove the parameter and the warning after v1.4.0 + if (!missing("conf.lev")) { + .warning(paste0("Argument 'conf.lev' is deprecated. Please use 'alpha' instead. ", + "'alpha' = ", 1 - conf.lev, " is used."), tag = '! Deprecation: ') + } ## alpha if (!is.numeric(alpha) | alpha < 0 | alpha > 1 | length(alpha) > 1) { stop("Parameter 'alpha' must be a numeric number between 0 and 1.") diff --git a/man/Corr.Rd b/man/Corr.Rd index 10bdf71..bbb1e34 100644 --- a/man/Corr.Rd +++ b/man/Corr.Rd @@ -18,6 +18,7 @@ Corr( conf = TRUE, sign = FALSE, alpha = 0.05, + conf.lev = NULL, ncores = NULL ) } @@ -66,6 +67,8 @@ FALSE.} \item{alpha}{A numeric indicating the significance level for the statistical significance test. The default value is 0.05.} +\item{conf.lev}{Deprecated. Use alpha now instead. alpha = 1 - conf.lev.} + \item{ncores}{An integer indicating the number of cores to use for parallel computation. The default value is NULL.} } -- GitLab From eefca4080c9e83e37ee250fb587c4be8221e21a7 Mon Sep 17 00:00:00 2001 From: aho Date: Mon, 20 Mar 2023 16:33:35 +0100 Subject: [PATCH 2/3] Remove warning --- R/DiffCorr.R | 2 -- 1 file changed, 2 deletions(-) diff --git a/R/DiffCorr.R b/R/DiffCorr.R index 1e07458..9307824 100644 --- a/R/DiffCorr.R +++ b/R/DiffCorr.R @@ -155,8 +155,6 @@ DiffCorr <- function(exp, obs, ref, N.eff = NA, time_dim = 'sdate', if (!test.type %in% c('two-sided', 'one-sided')) { stop("Parameter 'test.type' must be 'two-sided' or 'one-sided'.") } - #NOTE: warning can be removed in the next release - .warning("The default significance test has changed after s2dv_1.2.0. The default method is 'two-sided'.") ## ncores if (!is.null(ncores)) { -- GitLab From 10ef11290076a625fab282ea45f5a0815879f992 Mon Sep 17 00:00:00 2001 From: aho Date: Mon, 20 Mar 2023 16:34:15 +0100 Subject: [PATCH 3/3] Version bump to 1.4.0 --- .Rbuildignore | 2 +- DESCRIPTION | 4 ++-- NEWS.md | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 4212858..6008b57 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 and test-Load.R needs to be hidden #tests/testthat/test-CDORemap.R diff --git a/DESCRIPTION b/DESCRIPTION index 3a79ba6..eee31d4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: s2dv Title: A Set of Common Tools for Seasonal to Decadal Verification -Version: 1.3.0 +Version: 1.4.0 Authors@R: c( person("BSC-CNS", role = c("aut", "cph")), person("An-Chi", "Ho", , "an.ho@bsc.es", role = c("aut", "cre")), @@ -44,7 +44,7 @@ Imports: easyVerification Suggests: testthat -License: Apache License 2.0 +License: GPL-3 URL: https://earth.bsc.es/gitlab/es/s2dv/ BugReports: https://earth.bsc.es/gitlab/es/s2dv/-/issues LazyData: true diff --git a/NEWS.md b/NEWS.md index c7daf93..4711c9c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,26 @@ +# s2dv 1.4.0 (Release date: 2023-03-21) +**Bugfixes** +- AbsBiasSS() significance test bugfix +- RPSS() significance test bugfix +- Trend() output "p.val" bugfix when NAs exist +- RMS() bugfix when dat_dim is NULL and conf is FALSE +- NAO() parameter "ftime_avg" sanity check improvement +- CDORemap() recognizes the CDO version with non-numeric values +- CDORemap() reorders the unlimited dimension to the last position in order to save as netCDF correctly + +**Development** +- Make the argument default values consistent between functions +- Season() sanity check improvement +- RMSSS() new parameters: "ref", "memb_dim", "sig_method". RandomWalkTest() is one option for significance test. +- Corr() new output "sign" and change parameter "conf.lev" to "alpha" +- CRPSS() uses cross-validation when `ref` is NULL +- RPS() and RPSS(): New parameter "cross.val" to choose to use cross-validation or not +- New function: ROCSS() +- RandomWalkTest(): New parameters "alpha" and "test.type"; Test method options: 'two.sided.approx','two.sided','greater','less'; change from positively oriented to negatively oriented +- Reorder(): Reorder attribute "dimensions" along with the data reordering. The attribute exists in Load() objects. +- ProjectField() efficiency improvement +- NAO(): parameter "ftime_avg" can be NULL so no average is calculated + # s2dv 1.3.0 (Release date: 2022-10-17) - New functions: Bias, AbsBiasSS, CRPS, CRPSS - split RPSS parameter 'weights' into 'weights_exp' and 'weights_ref' -- GitLab