diff --git a/DESCRIPTION b/DESCRIPTION index 738d6bd904cd86a112a85679c07dd54a8982efde..280392e81f348fc91648ff51b7d303734db0745e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.0.13.10 +Version: 1.0.13.11 Date: 2018-08-31 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/NEWS.rmd b/NEWS.rmd index 2357128c4cb221740cb55b48fd31cb584aea2b81..445d93053492d87102f56b5d6c9921dea813ec92 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -14,7 +14,7 @@ output: -### 1.0.13.10 Release Notes (2018-08-31) +### 1.0.13.11 Release Notes (2018-08-31) #### Deprectated and defunct @@ -34,7 +34,9 @@ output: - <code>CreateInputsCrit()</code> now returns an error when <code>epsilon</code is not positive. -- <code>CreateInputsCrit()</code> now returns a warning message if the era zeroes values in <code>Qobs<$code> and <code>epsilon = NULL</code>. +- <code>CreateInputsCrit()</code> now returns a warning message if there are zeroes values in <code>Qobs</code> and <code>epsilon = NULL</code>. + +- <code>ErrorCrit*()</code> functions now return a warning message if there are zeroes values in <code>Qobs</code> or <code>Qsim</code> and <code>epsilon = NULL</code>. #### Minor user-visible changes diff --git a/R/ErrorCrit_KGE.R b/R/ErrorCrit_KGE.R index 048b529c5a3c7cfe3c5178f29f354cc50f010e88..7f45bfeffef969c60b9daa26860c5804859d8c00 100644 --- a/R/ErrorCrit_KGE.R +++ b/R/ErrorCrit_KGE.R @@ -42,6 +42,14 @@ ErrorCrit_KGE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T VarSim[!InputsCrit$BoolCrit] <- NA ##Data_transformation + if (InputsCrit$transfo %in% c("log", "inv") & is.null(InputsCrit$epsilon) & verbose) { + if (any(VarObs %in% 0)) { + warning("zeroes detected in Qobs: the corresponding time-steps will be exclude from the criteria computation if the epsilon agrument of 'CreateInputsCrit' = NULL") + } + if (any(VarSim %in% 0)) { + warning("zeroes detected in Qsim: the corresponding time-steps will be exclude from the criteria computation if the epsilon agrument of 'CreateInputsCrit' = NULL") + } + } if ("epsilon" %in% names(InputsCrit) & !is.null(InputsCrit$epsilon)) { VarObs <- VarObs + InputsCrit$epsilon VarSim <- VarSim + InputsCrit$epsilon diff --git a/R/ErrorCrit_KGE2.R b/R/ErrorCrit_KGE2.R index ebc4a942291ba43368759fccc6f9d2156f7ccc71..9de2e220a472162d3cac810ed47d5ee2fdf40da6 100644 --- a/R/ErrorCrit_KGE2.R +++ b/R/ErrorCrit_KGE2.R @@ -42,6 +42,14 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = VarSim[!InputsCrit$BoolCrit] <- NA ##Data_transformation + if (InputsCrit$transfo %in% c("log", "inv") & is.null(InputsCrit$epsilon) & verbose) { + if (any(VarObs %in% 0)) { + warning("zeroes detected in Qobs: the corresponding time-steps will be exclude from the criteria computation if the epsilon agrument of 'CreateInputsCrit' = NULL") + } + if (any(VarSim %in% 0)) { + warning("zeroes detected in Qsim: the corresponding time-steps will be exclude from the criteria computation if the epsilon agrument of 'CreateInputsCrit' = NULL") + } + } if ("epsilon" %in% names(InputsCrit) & !is.null(InputsCrit$epsilon)) { VarObs <- VarObs + InputsCrit$epsilon VarSim <- VarSim + InputsCrit$epsilon diff --git a/R/ErrorCrit_NSE.R b/R/ErrorCrit_NSE.R index 9fe2658b5bc3957409695083fc7ef26578937947..36d7bbfc2575bdc569a8eae18e50fab152e5526a 100644 --- a/R/ErrorCrit_NSE.R +++ b/R/ErrorCrit_NSE.R @@ -42,6 +42,14 @@ ErrorCrit_NSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = T VarSim[!InputsCrit$BoolCrit] <- NA ##Data_transformation + if (InputsCrit$transfo %in% c("log", "inv") & is.null(InputsCrit$epsilon) & verbose) { + if (any(VarObs %in% 0)) { + warning("zeroes detected in Qobs: the corresponding time-steps will be exclude from the criteria computation if the epsilon agrument of 'CreateInputsCrit' = NULL") + } + if (any(VarSim %in% 0)) { + warning("zeroes detected in Qsim: the corresponding time-steps will be exclude from the criteria computation if the epsilon agrument of 'CreateInputsCrit' = NULL") + } + } if ("epsilon" %in% names(InputsCrit) & !is.null(InputsCrit$epsilon)) { VarObs <- VarObs + InputsCrit$epsilon VarSim <- VarSim + InputsCrit$epsilon diff --git a/R/ErrorCrit_RMSE.R b/R/ErrorCrit_RMSE.R index aed56617026bd19cd7c2738e62c469b2aa4313c8..9ac0256cdecb366580880884d0ed3dbcbded84fa 100644 --- a/R/ErrorCrit_RMSE.R +++ b/R/ErrorCrit_RMSE.R @@ -42,6 +42,14 @@ ErrorCrit_RMSE <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = VarSim[!InputsCrit$BoolCrit] <- NA ##Data_transformation + if (InputsCrit$transfo %in% c("log", "inv") & is.null(InputsCrit$epsilon) & verbose) { + if (any(VarObs %in% 0)) { + warning("zeroes detected in Qobs: the corresponding time-steps will be exclude from the criteria computation if the epsilon agrument of 'CreateInputsCrit' = NULL") + } + if (any(VarSim %in% 0)) { + warning("zeroes detected in Qsim: the corresponding time-steps will be exclude from the criteria computation if the epsilon agrument of 'CreateInputsCrit' = NULL") + } + } if ("epsilon" %in% names(InputsCrit) & !is.null(InputsCrit$epsilon)) { VarObs <- VarObs + InputsCrit$epsilon VarSim <- VarSim + InputsCrit$epsilon