Commit 035fca61 authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.2.7.4 UPDATE: remove the possibility to use "SD" as a varObs in CreateInputsCrit

Showing with 9 additions and 9 deletions
+9 -9
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")),
......
......@@ -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>.
......
......@@ -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,
......
......@@ -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)}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment