From 95b300457ddf0c98afe4bd0ffed7b5e5fd1baa37 Mon Sep 17 00:00:00 2001
From: Dorchies David <david.dorchies@irstea.fr>
Date: Tue, 5 Jan 2021 13:49:21 +0100
Subject: [PATCH] v1.6.8.33 feat(SeriesAggreg): remove ConvertFun default value

Refs #41
---
 DESCRIPTION                        | 4 ++--
 NAMESPACE                          | 3 ---
 NEWS.md                            | 2 +-
 R/SeriesAggreg.data.frame.R        | 2 +-
 man/SeriesAggreg.Rd                | 7 +------
 tests/testthat/test-SeriesAggreg.R | 3 ++-
 6 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 7def0fac..a572c530 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.8.32
-Date: 2020-12-23
+Version: 1.6.8.33
+Date: 2021-01-05
 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 1be9c1e1..5d211da1 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -63,9 +63,6 @@ export(TransfoParam_GR5J)
 export(TransfoParam_GR6J)
 export(TransfoParam_Lag)
 export(.ErrorCrit)
-export(.AggregConvertFunTable)
-
-
 
 
 #####################################
diff --git a/NEWS.md b/NEWS.md
index f3212877..9addb94c 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,7 +2,7 @@
 
 
 
-### 1.6.8.32 Release Notes (2020-12-23)
+### 1.6.8.33 Release Notes (2021-01-05)
 
 #### New features
 
diff --git a/R/SeriesAggreg.data.frame.R b/R/SeriesAggreg.data.frame.R
index efbd9bec..fd97145b 100644
--- a/R/SeriesAggreg.data.frame.R
+++ b/R/SeriesAggreg.data.frame.R
@@ -1,6 +1,6 @@
 SeriesAggreg.data.frame <- function(x,
                                     Format,
-                                    ConvertFun = getAggregConvertFun(names(x)[-1]),
+                                    ConvertFun,
                                     TimeFormat = NULL,
                                     NewTimeFormat = NULL,
                                     YearFirstMonth = 1,
diff --git a/man/SeriesAggreg.Rd b/man/SeriesAggreg.Rd
index 2fe8a567..41d4a8a3 100644
--- a/man/SeriesAggreg.Rd
+++ b/man/SeriesAggreg.Rd
@@ -24,16 +24,11 @@ Warning: on the aggregated outputs, the dates correspond to the beginning of the
   \code{\link{SeriesAggreg.InputsModel}} and \code{\link{SeriesAggreg.OutputsModel}}
   call \code{\link{SeriesAggreg.list}} which itself calls \code{\link{SeriesAggreg.data.frame}}.
   So, all arguments passed to any \code{\link{SeriesAggreg}} method will be passed to \code{\link{SeriesAggreg.data.frame}}.
-
-  If \code{ConvertFun} is not provided, the operation to perform is guessed from the name of the list items or column
-  name dataframe in respect with the matching table \code{.AggregConvertFunTable}.
 }
-
-
 \usage{
 \method{SeriesAggreg}{data.frame}(x,
              Format,
-             ConvertFun = getAggregConvertFun(names(x)[-1]),
+             ConvertFun,
              TimeFormat = NULL,
              NewTimeFormat = NULL,
              YearFirstMonth = 1,
diff --git a/tests/testthat/test-SeriesAggreg.R b/tests/testthat/test-SeriesAggreg.R
index 905a6f19..f71db818 100644
--- a/tests/testthat/test-SeriesAggreg.R
+++ b/tests/testthat/test-SeriesAggreg.R
@@ -66,7 +66,8 @@ test_that("Check SeriesAggreg output values on yearly aggregation", {
                                c("P", "E", "Qmm")], 2, sum)
   TestedValues <- unlist(SeriesAggreg(TabSeries,
                                       Format = "%Y",
-                                      YearFirstMonth = 9)[1, c("P", "E", "Qmm")])
+                                      YearFirstMonth = 9,
+                                      ConvertFun = rep("sum", 3))[1, c("P", "E", "Qmm")])
   expect_equal(GoodValues, TestedValues)
 })
 
-- 
GitLab