From 4863f7a66db33bdf9bb8a385c70f425fc1a11eaa Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.fr>
Date: Fri, 8 Jan 2021 10:18:27 +0100
Subject: [PATCH] v1.6.9.1 build(NAMESPACE): change class of SeriesAggreg.list
 to avoid the use of '['.InputsModel and '['.OutputsModel when the ' ('
 function is used Refs #67

---
 DESCRIPTION           | 2 +-
 NEWS.md               | 2 +-
 R/SeriesAggreg.list.R | 6 +++++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 07e43cc9..4483efe4 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.6.9.1
+Version: 1.6.9.2
 Date: 2021-01-08
 Authors@R: c(
   person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
diff --git a/NEWS.md b/NEWS.md
index f976a4bf..3f943f81 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,7 +2,7 @@
 
 
 
-### 1.6.9.1 Release Notes (2021-01-08)
+### 1.6.9.2 Release Notes (2021-01-08)
 
 #### New features
 
diff --git a/R/SeriesAggreg.list.R b/R/SeriesAggreg.list.R
index 8834347d..ab7df82d 100644
--- a/R/SeriesAggreg.list.R
+++ b/R/SeriesAggreg.list.R
@@ -6,6 +6,10 @@ SeriesAggreg.list <- function(x,
                               except = NULL,
                               recursive = TRUE,
                               ...) {
+
+  classIni <- class(x)
+  class(x) <- "list" # in order to avoid the use of '['.InputsModel' or '['.OutputsModel' when x[i] is used
+
   if (missing(Format)) {
     Format <- .GetSeriesAggregFormat(NewTimeFormat)
   } else if (!is.null(NewTimeFormat)) {
@@ -143,7 +147,7 @@ SeriesAggreg.list <- function(x,
 
     class(res) <- gsub("hourly|daily|monthly|yearly",
                        .GetSeriesAggregClass(Format),
-                       class(x))
+                       classIni)
 
     return(res)
 
-- 
GitLab