From 1f7169aa14e5470e0ee649bd048d35f2fff13f0f Mon Sep 17 00:00:00 2001 From: Delaigue Olivier <olivier.delaigue@irstea.priv> Date: Mon, 22 Oct 2018 17:36:36 +0200 Subject: [PATCH] v1.1.2.2 UPDATE: ErrorCrit_KGE2 compatible with new InputsCrit objects --- DESCRIPTION | 2 +- R/ErrorCrit_KGE2.R | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0b28246f..81f3d9a2 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.1.2.1 +Version: 1.1.2.2 Date: 2018-10-22 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/R/ErrorCrit_KGE2.R b/R/ErrorCrit_KGE2.R index 66f0f889..8a8791a4 100644 --- a/R/ErrorCrit_KGE2.R +++ b/R/ErrorCrit_KGE2.R @@ -6,6 +6,10 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = stop("InputsCrit must be of class 'InputsCrit' \n") return(NULL) } + if (inherits(InputsCrit, "Multi") | inherits(InputsCrit, "Compo")) { + stop("InputsCrit must be of class 'Single' \n") + return(NULL) + } if (!inherits(OutputsModel, "OutputsModel")) { stop("OutputsModel must be of class 'OutputsModel' \n") return(NULL) @@ -36,7 +40,7 @@ ErrorCrit_KGE2 <- function(InputsCrit, OutputsModel, warnings = TRUE, verbose = ##Data_preparation_______________________________ - VarObs <- InputsCrit$Qobs + VarObs <- InputsCrit$obs VarObs[!InputsCrit$BoolCrit] <- NA VarSim <- OutputsModel$Qsim VarSim[!InputsCrit$BoolCrit] <- NA -- GitLab