diff --git a/DESCRIPTION b/DESCRIPTION index e4683b62fe0ee3454c0b1ff54d13bf4e1f186d9f..c2c76835a59b44d66a2be6d1eab1df8358555fb0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.2.7.3 -Date: 2019-03-01 +Version: 1.2.7.4 +Date: 2019-03-04 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Charles", "Perrin", role = c("aut", "ths"), comment = c(ORCID = "0000-0001-8552-1881")), diff --git a/NEWS.rmd b/NEWS.rmd index 8ad84bc1ad6e6d502504e688f3460b6b14099417..e7cace176129c4d1986af3319fc3a58d15415376 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -13,7 +13,7 @@ output: -### 1.2.7.3 Release Notes (2019-03-01) +### 1.2.7.4 Release Notes (2019-03-04) @@ -30,7 +30,7 @@ output: - <code>CreateInputsCrit()</code> now can prepare an <code>InputsCrit</code> object in order to compute a single criterion (<code>Single</code> class), multiple criteria (<code>Multi</code> class) with the <code>ErrorCrit()</code> function. So it is now possible to set the following arguments as atomic (as before) or as list: <code>FUN_CRIT</code>, <code>obs</code>, <code>BoolCrit</code>, <code>transfo</code>, <code>weights</code>. If the list format is chosen, all the lists must have the same length. -- <code>CreateInputsCrit()</code> now presents a <code>varObs</code> argument in order to prepare an <code>InputsCrit</code> object in order run a criterion on other variable than observed discharges with the <code>ErrorCrit()</code> function (e.g. SCA, SWE or SD). +- <code>CreateInputsCrit()</code> now presents a <code>varObs</code> argument in order to prepare an <code>InputsCrit</code> object in order run a criterion on other variable than observed discharges with the <code>ErrorCrit()</code> function (e.g. SCA, SWE). - <code>CreateInputsCrit()</code> now presents a <code>weights</code> argument in order to prepare an <code>InputsCrit</code> object in order to compute a composite criterion (<code>Compo</code> class) with <code>ErrorCrit()</code> or <code>Calibration_Michel()</code>. diff --git a/R/CreateInputsCrit.R b/R/CreateInputsCrit.R index 8b09dc426727157489ab68b08211d9901f8a6484..02cab1740cd8bc38183292033200e3fa1ff972f4 100644 --- a/R/CreateInputsCrit.R +++ b/R/CreateInputsCrit.R @@ -115,14 +115,14 @@ CreateInputsCrit <- function(FUN_CRIT, if (length(listArgs$weights) > 1 & sum(unlist(listArgs$weights)) == 0 & !any(sapply(listArgs$weights, is.null))) { stop("sum of 'weights' cannot be equal to zero") } - + ## reformat list of arguments listArgs2 <- lapply(seq_along(listArgs$FUN_CRIT), function(i) lapply(listArgs, "[[", i)) ## preparation of warning messages - inVarObs <- c("Q", "SCA", "SWE", "SD") + inVarObs <- c("Q", "SCA", "SWE") msgVarObs <- "'varObs' must be a (list of) character vector(s) and one of %s" msgVarObs <- sprintf(msgVarObs, paste(sapply(inVarObs, shQuote), collapse = ", ")) inTransfo <- c("", "sqrt", "log", "inv", "sort") @@ -172,7 +172,7 @@ CreateInputsCrit <- function(FUN_CRIT, stop("'obs' outside [0,1] for \"SCA\" for 'varObs'", call. = FALSE) } } - inPosVarObs <- c("Q", "SWE", "SD") + inPosVarObs <- c("Q", "SWE") if (any(iListArgs2$varObs %in% inPosVarObs)) { idQSS <- which(iListArgs2$varObs %in% inPosVarObs) vecQSS <- unlist(iListArgs2$obs[idQSS]) @@ -213,7 +213,7 @@ CreateInputsCrit <- function(FUN_CRIT, warning(sprintf(warn_log_kge, "KGE'"), call. = FALSE) } } - + ## Create InputsCrit iInputsCrit <- list(FUN_CRIT = iListArgs2$FUN_CRIT, obs = iListArgs2$obs, diff --git a/man/CreateInputsCrit.Rd b/man/CreateInputsCrit.Rd index 62994c1ebc375644c4efd3b90ce5b52551d3e7c7..c1fcbf1c968a274ef9e5d63851fbf9a5b1f414ec 100644 --- a/man/CreateInputsCrit.Rd +++ b/man/CreateInputsCrit.Rd @@ -28,7 +28,7 @@ CreateInputsCrit(FUN_CRIT, InputsModel, RunOptions, \item{obs}{[numeric (atomic or list)] series of observed variable (typically discharge [mm/time step])} -\item{varObs}{(optional) [character (atomic or list)] names of the observed variable (\code{"Q"} by default, or one of \code{"SCA"}, \code{"SWE"}, \code{"SD"}])} +\item{varObs}{(optional) [character (atomic or list)] names of the observed variable (\code{"Q"} by default, or one of \code{"SCA"}, \code{"SWE"}])} \item{BoolCrit}{(optional) [boolean (atomic or list)] boolean (the same length as \code{obs}) giving the time steps to consider in the computation (all time steps are considered by default)}