From 73e7448b7b531b78cfb93348189ecd205f263f19 Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.fr>
Date: Mon, 18 Jan 2021 17:20:16 +0100
Subject: [PATCH] v1.6.9.27 revert: remove [.OutputsModel S3 method Refs #89

---
 DESCRIPTION     |  4 ++--
 NAMESPACE       |  4 ++--
 NEWS.md         |  4 ++--
 R/Utils.R       | 28 ++++++++++++++--------------
 man/RunModel.Rd | 14 +++++++-------
 5 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 2873a5c4..33863672 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.6.9.26
-Date: 2021-01-14
+Version: 1.6.9.27
+Date: 2021-01-18
 Authors@R: c(
   person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
   person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
diff --git a/NAMESPACE b/NAMESPACE
index d942354b..c98743b3 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -9,7 +9,7 @@ useDynLib(airGR, .registration = TRUE)
 ##            S3 methods           ##
 #####################################
 S3method('[', InputsModel)
-S3method('[', OutputsModel)
+#S3method('[', OutputsModel) ### to add in version 2.0
 S3method(plot, OutputsModel)
 S3method(SeriesAggreg, data.frame)
 S3method(SeriesAggreg, list)
@@ -37,7 +37,7 @@ export(ErrorCrit_RMSE)
 export(Imax)
 export(PE_Oudin)
 export(PEdaily_Oudin)
-export(plot.OutputsModel)
+export(plot.OutputsModel) ### to remove from version 2.0
 export(RunModel)
 export(RunModel_CemaNeige)
 export(RunModel_CemaNeigeGR4H)
diff --git a/NEWS.md b/NEWS.md
index 61bc84a3..bb266368 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,7 +2,7 @@
 
 
 
-### 1.6.9.26 Release Notes (2021-01-14)
+### 1.6.9.27 Release Notes (2021-01-18)
 
 #### New features
 
@@ -12,7 +12,7 @@
 - `PE_Oudin()` now presents a `RunFortran` argument to run the code in Fortran or in R. The Fortran mode is the fastest. ([#62](https://gitlab.irstea.fr/HYCAR-Hydro/airgr/-/issues/62))
 - Added `RunModel_Lag()` which allows to perform a single run for the Lag model over the test period in order to run semi-distributed GR models. ([#34](https://gitlab.irstea.fr/HYCAR-Hydro/airgr/-/issues/34))
 - Added the 'sd_model' vignette to explain how to manage the use of semi-distributed GR models. ([#34](https://gitlab.irstea.fr/HYCAR-Hydro/airgr/-/issues/34))
-- Added `[` S3 method for `InputsModel` and `OutputsModel` class objects in order to extract subsets of them. ([#67](https://gitlab.irstea.fr/HYCAR-Hydro/airgr/-/issues/67))
+- Added `[` S3 method for `InputsModel` class object in order to extract subsets of it. ([#67](https://gitlab.irstea.fr/HYCAR-Hydro/airgr/-/issues/67))
 
 
 #### Deprecated and defunct
diff --git a/R/Utils.R b/R/Utils.R
index ddbdd449..79bc41e5 100644
--- a/R/Utils.R
+++ b/R/Utils.R
@@ -129,7 +129,7 @@
 }
 
 
-## InputsModel
+## OutputsModel
 
 .ExtractOutputsModel <- function(x, i) {
   res <- lapply(x, function(x) {
@@ -154,16 +154,16 @@
   res
 }
 
-'[.OutputsModel' <- function(x, i) {
-  if (!inherits(x, "OutputsModel")) {
-    stop("'x' must be of class 'OutputsModel'")
-  }
-  if (is.factor(i)) {
-    i <- as.character(i)
-  }
-  if (is.numeric(i)) {
-    .ExtractOutputsModel(x, i)
-  } else {
-    NextMethod()
-  }
-}
+# '[.OutputsModel' <- function(x, i) {
+#   if (!inherits(x, "OutputsModel")) {
+#     stop("'x' must be of class 'OutputsModel'")
+#   }
+#   if (is.factor(i)) {
+#     i <- as.character(i)
+#   }
+#   if (is.numeric(i)) {
+#     .ExtractOutputsModel(x, i)
+#   } else {
+#     NextMethod()
+#   }
+# }
diff --git a/man/RunModel.Rd b/man/RunModel.Rd
index efead0f0..2e76d41d 100644
--- a/man/RunModel.Rd
+++ b/man/RunModel.Rd
@@ -3,7 +3,7 @@
 
 \name{RunModel}
 \alias{RunModel}
-\alias{[.OutputsModel}
+%\alias{[.OutputsModel}
 
 
 \title{Run with the provided hydrological model function}
@@ -16,8 +16,8 @@ Function which performs a single model run with the provided function over the s
 
 \usage{
 RunModel(InputsModel, RunOptions, Param, FUN_MOD)
-
-\method{[}{OutputsModel}(x, i)
+%
+%\method{[}{OutputsModel}(x, i)
 }
 
 
@@ -29,10 +29,10 @@ RunModel(InputsModel, RunOptions, Param, FUN_MOD)
 \item{Param}{[numeric] vector of model parameters (See details for SD lag model)}
 
 \item{FUN_MOD}{[function] hydrological model function (e.g. \code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}})}
-
-\item{x}{[InputsModel] object of class InputsModel}
-
-\item{i}{[integer] of the indices to subset a time series or [character] names of the elements to extract}
+%
+%\item{x}{[InputsModel] object of class InputsModel}
+%
+%\item{i}{[integer] of the indices to subset a time series or [character] names of the elements to extract}
 }
 
 
-- 
GitLab