From e1699d90073d6bf1da25d6d630e9a26baa1fa83c Mon Sep 17 00:00:00 2001
From: unknown <olivier.delaigue@ANPI1430.antony.irstea.priv>
Date: Tue, 30 Jan 2018 11:21:31 +0100
Subject: [PATCH] v0.1.11.2 bug fixed in warm-up, calibration and simulation
 periods checks in CalGR and SimGR functions

---
 DESCRIPTION | 2 +-
 R/CalGR.R   | 4 ++--
 R/SimGR.R   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index c5a2834..bdd74e1 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: airGRteaching
 Type: Package
 Title: Tools to Simplify the Use of the airGR Hydrological Package for Education (Including a Shiny Interface)
-Version: 0.1.11.1
+Version: 0.1.11.2
 Date: 2018-01-29
 Authors@R: c(person("Olivier", "Delaigue", role = c("aut", "cre"), email = "airGR@irstea.fr"), person("Laurent", "Coron", role = c("aut")), person("Pierre", "Brigode", role = c("aut")), person("Guillaume", "Thirel", role = c("ctb")))
 Depends: airGR (>= 1.0.9.43)
diff --git a/R/CalGR.R b/R/CalGR.R
index d6655a0..dc549ea 100644
--- a/R/CalGR.R
+++ b/R/CalGR.R
@@ -11,7 +11,7 @@ CalGR <- function(PrepGR, CalCrit = c("NSE", "KGE", "KGE2", "RMSE"),
     if (any(is.na(WupPer))) {
       stop("Non convenient date format for the warm-up period \"WupPer\"")
     } else {
-      if (! (any(PrepGR$InputsModel$DatesR == WupPer[1]) & any(PrepGR$InputsModel$DatesR == WupPer[2]))) {
+      if (!any(PrepGR$InputsModel$DatesR == WupPer[1]) | !any(PrepGR$InputsModel$DatesR == WupPer[2])) {
         stop("Non convenient date for the warm-up period \"WupPer\"")
       } else {
         WupInd <- which(PrepGR$InputsModel$DatesR == WupPer[1]):which(PrepGR$InputsModel$DatesR == WupPer[2])
@@ -23,7 +23,7 @@ CalGR <- function(PrepGR, CalCrit = c("NSE", "KGE", "KGE2", "RMSE"),
   if (any(is.na(CalPer))) {
     stop("Non convenient date format for the calibration period \"CalPer\"")
   } else {
-    if (! (any(PrepGR$InputsModel$DatesR == CalPer[1]) & any(PrepGR$InputsModel$DatesR == CalPer[2]))) {
+    if (!any(PrepGR$InputsModel$DatesR == CalPer[1]) | !any(PrepGR$InputsModel$DatesR == CalPer[2])) {
       stop("Non convenient date for the calibration period \"CalPer\"")
     } else {
       CalInd <- which(PrepGR$InputsModel$DatesR == CalPer[1]):which(PrepGR$InputsModel$DatesR == CalPer[2])
diff --git a/R/SimGR.R b/R/SimGR.R
index bb7a5d7..20812d5 100644
--- a/R/SimGR.R
+++ b/R/SimGR.R
@@ -22,7 +22,7 @@ SimGR <- function(PrepGR, CalGR = NULL, Param = NULL, EffCrit = c("NSE", "KGE",
     if (any(is.na(WupPer))) {
       stop("Non convenient date format for the warm-up period \"WupPer\"")
     } else {
-      if (! (any(PrepGR$InputsModel$DatesR == WupPer[1]) & any(PrepGR$InputsModel$DatesR == WupPer[1]))) {
+      if (!any(PrepGR$InputsModel$DatesR == WupPer[1]) | !any(PrepGR$InputsModel$DatesR == WupPer[2])) {
         stop("Non convenient date for the warm-up period \"WupPer\"")
       } else {
         WupInd <- which(PrepGR$InputsModel$DatesR == WupPer[1]):which(PrepGR$InputsModel$DatesR == WupPer[2])
@@ -34,7 +34,7 @@ SimGR <- function(PrepGR, CalGR = NULL, Param = NULL, EffCrit = c("NSE", "KGE",
   if (any(is.na(SimPer))) {
     stop("Non convenient date format for the simulation period \"SimPer\"")
   } else {
-    if (! (any(PrepGR$InputsModel$DatesR == SimPer[1]) & any(PrepGR$InputsModel$DatesR == SimPer[2]))) {
+    if (!any(PrepGR$InputsModel$DatesR == SimPer[1]) | !any(PrepGR$InputsModel$DatesR == SimPer[2])) {
       stop("Non convenient date for the simulation period \"SimPer\"")
     } else {
       SimInd <- which(PrepGR$InputsModel$DatesR == SimPer[1]):which(PrepGR$InputsModel$DatesR == SimPer[2])
-- 
GitLab