Commit 73e7448b authored by Delaigue Olivier's avatar Delaigue Olivier
Browse files

v1.6.9.27 revert: remove [.OutputsModel S3 method

Refs #89
parent 17cbe8c0
Pipeline #19530 canceled with stages
in 17 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.26 Version: 1.6.9.27
Date: 2021-01-14 Date: 2021-01-18
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")),
person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"), person("Olivier", "Delaigue", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-7668-8468"), email = "airGR@inrae.fr"),
......
...@@ -9,7 +9,7 @@ useDynLib(airGR, .registration = TRUE) ...@@ -9,7 +9,7 @@ useDynLib(airGR, .registration = TRUE)
## S3 methods ## ## S3 methods ##
##################################### #####################################
S3method('[', InputsModel) S3method('[', InputsModel)
S3method('[', OutputsModel) #S3method('[', OutputsModel) ### to add in version 2.0
S3method(plot, OutputsModel) S3method(plot, OutputsModel)
S3method(SeriesAggreg, data.frame) S3method(SeriesAggreg, data.frame)
S3method(SeriesAggreg, list) S3method(SeriesAggreg, list)
...@@ -37,7 +37,7 @@ export(ErrorCrit_RMSE) ...@@ -37,7 +37,7 @@ export(ErrorCrit_RMSE)
export(Imax) export(Imax)
export(PE_Oudin) export(PE_Oudin)
export(PEdaily_Oudin) export(PEdaily_Oudin)
export(plot.OutputsModel) export(plot.OutputsModel) ### to remove from version 2.0
export(RunModel) export(RunModel)
export(RunModel_CemaNeige) export(RunModel_CemaNeige)
export(RunModel_CemaNeigeGR4H) export(RunModel_CemaNeigeGR4H)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
### 1.6.9.26 Release Notes (2021-01-14) ### 1.6.9.27 Release Notes (2021-01-18)
#### New features #### New features
...@@ -12,7 +12,7 @@ ...@@ -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)) - `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 `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 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 #### Deprecated and defunct
......
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
} }
## InputsModel ## OutputsModel
.ExtractOutputsModel <- function(x, i) { .ExtractOutputsModel <- function(x, i) {
res <- lapply(x, function(x) { res <- lapply(x, function(x) {
...@@ -154,16 +154,16 @@ ...@@ -154,16 +154,16 @@
res res
} }
'[.OutputsModel' <- function(x, i) { # '[.OutputsModel' <- function(x, i) {
if (!inherits(x, "OutputsModel")) { # if (!inherits(x, "OutputsModel")) {
stop("'x' must be of class 'OutputsModel'") # stop("'x' must be of class 'OutputsModel'")
} # }
if (is.factor(i)) { # if (is.factor(i)) {
i <- as.character(i) # i <- as.character(i)
} # }
if (is.numeric(i)) { # if (is.numeric(i)) {
.ExtractOutputsModel(x, i) # .ExtractOutputsModel(x, i)
} else { # } else {
NextMethod() # NextMethod()
} # }
} # }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\name{RunModel} \name{RunModel}
\alias{RunModel} \alias{RunModel}
\alias{[.OutputsModel} %\alias{[.OutputsModel}
\title{Run with the provided hydrological model function} \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 ...@@ -16,8 +16,8 @@ Function which performs a single model run with the provided function over the s
\usage{ \usage{
RunModel(InputsModel, RunOptions, Param, FUN_MOD) RunModel(InputsModel, RunOptions, Param, FUN_MOD)
%
\method{[}{OutputsModel}(x, i) %\method{[}{OutputsModel}(x, i)
} }
...@@ -29,10 +29,10 @@ RunModel(InputsModel, RunOptions, Param, FUN_MOD) ...@@ -29,10 +29,10 @@ RunModel(InputsModel, RunOptions, Param, FUN_MOD)
\item{Param}{[numeric] vector of model parameters (See details for SD lag model)} \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{FUN_MOD}{[function] hydrological model function (e.g. \code{\link{RunModel_GR4J}}, \code{\link{RunModel_CemaNeigeGR4J}})}
%
\item{x}{[InputsModel] object of class InputsModel} %\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{i}{[integer] of the indices to subset a time series or [character] names of the elements to extract}
} }
......
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