diff --git a/DESCRIPTION b/DESCRIPTION index 93f4a71875db9d1747f2c88b4bea339b9dd123fe..cd51da6183d3062f64c2a78e4702b30600a7eefd 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.4.8.6 +Version: 1.4.8.7 Date: 2020-05-04 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 b16c55338e67ad8b23a83a2a52b271202a6ad91c..328bd03b0914bf96329957a370a02d3ffcfe98b3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ -### 1.4.8.6 Release Notes (2020-05-04) +### 1.4.8.7 Release Notes (2020-05-04) #### New features diff --git a/R/SeriesAggreg2.default.R b/R/SeriesAggreg2.default.R index a68bbc5f8ab272e37d25576fe191f490efc65b43..f67bc5cc34b2c8719ebe38a89dcbeb9eb7be939d 100644 --- a/R/SeriesAggreg2.default.R +++ b/R/SeriesAggreg2.default.R @@ -33,6 +33,7 @@ SeriesAggreg2.default <- function(TabSeries, names(tmp) <- paste(names(CemaNeigeLayers)[iLayer], names(tmp), sep = ".") tmp }) + names(CemaNeigeLayers) <- grep("^Layer", names(TabSeries), value = TRUE) } if (inherits(TabSeries, "OutputsModel") ){ CemaNeigeLayers <- TabSeries$CemaNeigeLayers @@ -45,6 +46,7 @@ SeriesAggreg2.default <- function(TabSeries, YearFirstMonth = YearFirstMonth, TimeLag = TimeLag, verbose = verbose) res <- res[, -1L] + colnames(res) <- gsub(".*[.]", "", colnames(res)) res <- as.list(res) }) } @@ -79,7 +81,13 @@ SeriesAggreg2.default <- function(TabSeries, res <- as.list(NewTabSeries) if (inherits(TabSeries, "CemaNeige")) { - res$CemaNeigeLayers <- CemaNeigeLayersAggreg + if (inherits(TabSeries, "InputsModel")) { + res <- c(NewTabSeries, CemaNeigeLayersAggreg) + } + if (inherits(TabSeries, "OutputsModel")) { + res$CemaNeigeLayers <- CemaNeigeLayersAggreg + } + # res <- append(res, CemaNeigeLayersAggreg, after = length(res)) } class(res) <- gsub("hourly|daily|monthly|yearly", ClassFormat, class(TabSeries))