Commit d374b49f authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.6.9.8 fix: add exceptions when .ExtractInputsModel run on SD objects in...

v1.6.9.8 fix: add exceptions when .ExtractInputsModel run on SD objects in order to manage with Qupstream, LengthHydro and BasinAreas
Refs #67
parent a644ed82
Pipeline #18988 passed with stages
in 12 minutes and 41 seconds
Package: airGR Package: airGR
Type: Package Type: Package
Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
Version: 1.6.9.7 Version: 1.6.9.8
Date: 2021-01-08 Date: 2021-01-08
Authors@R: c( Authors@R: c(
person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
### 1.6.9.7 Release Notes (2021-01-08) ### 1.6.9.8 Release Notes (2021-01-08)
#### New features #### New features
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
.ExtractInputsModel <- function(x, i) { .ExtractInputsModel <- function(x, i) {
res <- lapply(x, function(x) { res <- lapply(x, function(x) {
if (is.matrix(x)) { if (is.matrix(x)) {
res0 <- x[i, ] res0 <- x[i, , drop = FALSE]
} }
if (is.vector(x) | inherits(x, "POSIXt")) { if (is.vector(x) | inherits(x, "POSIXt")) {
res0 <- x[i] res0 <- x[i]
...@@ -105,6 +105,10 @@ ...@@ -105,6 +105,10 @@
if (!is.null(x$ZLayers)) { if (!is.null(x$ZLayers)) {
res$ZLayers <- x$ZLayers res$ZLayers <- x$ZLayers
} }
if (inherits(x, "SD")) {
res$LengthHydro <- x$LengthHydro
res$BasinAreas <- x$BasinAreas
}
class(res) <- class(x) class(res) <- class(x)
res res
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment