diff --git a/DESCRIPTION b/DESCRIPTION index a6074eef6714be39fc082d8ad56b648b53dae38d..2d31e79c54e9669fbb9557f1fbaa7cc25b679f06 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -38,3 +38,4 @@ BugReports: https://gitlab.irstea.fr/HYCAR-Hydro/airgr/-/issues NeedsCompilation: yes Encoding: UTF-8 VignetteBuilder: knitr +RoxygenNote: 7.1.1 diff --git a/NAMESPACE b/NAMESPACE index fe1f04810b57149b90498c4180c05cb87c03e55e..138db937ab679c768065c17552e32dd0effebf62 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,7 +27,7 @@ export(CreateCalibOptions) export(CreateErrorCrit_GAPX) export(CreateIniStates) export(CreateInputsCrit) -export(CreateInputsCrit_DeLavenne) +export(CreateInputsCrit_Lavenne) export(CreateInputsModel) export(CreateRunOptions) export(DataAltiExtrapolation_Valery) diff --git a/R/CreateInputsCrit_DeLavenne.R b/R/CreateInputsCrit_Lavenne.R similarity index 96% rename from R/CreateInputsCrit_DeLavenne.R rename to R/CreateInputsCrit_Lavenne.R index 92f1ea4dca7a523502ec7c2112bf4887140bc287..f9bed6d1ac15d31ed5eb627821663e9dfc6c2a0a 100644 --- a/R/CreateInputsCrit_DeLavenne.R +++ b/R/CreateInputsCrit_Lavenne.R @@ -1,4 +1,4 @@ -CreateInputsCrit_DeLavenne <- function(FUN_CRIT = ErrorCrit_KGE, +CreateInputsCrit_Lavenne <- function(FUN_CRIT = ErrorCrit_KGE, InputsModel, RunOptions, Obs, diff --git a/man/CreateInputsCrit_DeLavenne.Rd b/man/CreateInputsCrit_Lavenne.Rd similarity index 91% rename from man/CreateInputsCrit_DeLavenne.Rd rename to man/CreateInputsCrit_Lavenne.Rd index a16fd96f6e2856c048b312935af8bfc4df60a2fb..045973000d816da8d114ce4dfa5ba78bdddeff03 100644 --- a/man/CreateInputsCrit_DeLavenne.Rd +++ b/man/CreateInputsCrit_Lavenne.Rd @@ -1,8 +1,8 @@ \encoding{UTF-8} -\name{CreateInputsCrit_DeLavenne} -\alias{CreateInputsCrit_DeLavenne} +\name{CreateInputsCrit_Lavenne} +\alias{CreateInputsCrit_Lavenne} \title{Creation of the InputsCrit object for De Lavenne Criterion} @@ -14,7 +14,7 @@ Creation of the \code{InputsCrit} object required to the \code{\link{ErrorCrit}} \usage{ -CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE, +CreateInputsCrit_Lavenne(FUN_CRIT = ErrorCrit_KGE, InputsModel, RunOptions, Obs, @@ -55,7 +55,7 @@ CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE, \value{ -\code{CreateInputsCrit_DeLavenne} returns an object of class \emph{Compo} that is a list of lists such as the one described in \code{\link{CreateInputsCrit}}. +\code{CreateInputsCrit_Lavenne} returns an object of class \emph{Compo} that is a list of lists such as the one described in \code{\link{CreateInputsCrit}}. Items \code{Weights} of the criteria are respectively equal to \code{k} and \code{k * max(0,AprCrit)}. @@ -70,7 +70,7 @@ The parameters \code{FUN_CRIT}, \code{Obs}, \code{VarObs}, \code{BoolCrit}, \cod \code{\link{ErrorCrit_RMSE}} cannot be used in a composite criterion since it is not a unitless value. -\code{CreateInputsCrit_DeLavenne} creates a composed criterion in respect with Equations 1 and 2 of de Lavenne et al. (2019). +\code{CreateInputsCrit_Lavenne} creates a composed criterion in respect with Equations 1 and 2 of de Lavenne et al. (2019). } @@ -101,7 +101,7 @@ OutputsModel <- RunModel_GR4J(InputsModel = InputsModel, AprParamR <- c(X1 = 157, X2 = 0.8, X3 = 100, X4 = 1.5) ## Single efficiency criterion: GAPX with a priori parameters -IC_DL <- CreateInputsCrit_DeLavenne(InputsModel = InputsModel, +IC_DL <- CreateInputsCrit_Lavenne(InputsModel = InputsModel, RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run], AprParamR = AprParamR) diff --git a/tests/testthat/test-CreateInputsCrit_DeLavenne.R b/tests/testthat/test-CreateInputsCrit_Lavenne.R similarity index 92% rename from tests/testthat/test-CreateInputsCrit_DeLavenne.R rename to tests/testthat/test-CreateInputsCrit_Lavenne.R index 8aa40e49b9c114a3de07d85899e5f3debbb75b08..c61f1a0055f362696e10409ca883e2771db78361 100644 --- a/tests/testthat/test-CreateInputsCrit_DeLavenne.R +++ b/tests/testthat/test-CreateInputsCrit_Lavenne.R @@ -1,4 +1,4 @@ -context("CreateInputsCrit_DeLavenne") +context("CreateInputsCrit_Lavenne") data(L0123001) InputsModel <- CreateInputsModel(FUN_MOD = RunModel_GR4J, DatesR = BasinObs$DatesR, @@ -14,7 +14,7 @@ OutputsModel <- RunModel_GR4J(InputsModel = InputsModel, RunOptions = RunOptions, Param = Param) k <- 0.15 -IC_DL <- CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE, +IC_DL <- CreateInputsCrit_Lavenne(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel, RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run], @@ -40,7 +40,7 @@ test_that("should return KGE*(1-k)+k with parameters matching a priori parameter test_that("should return proper error if mismatch number of parameters", { expect_error( - CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE, + CreateInputsCrit_Lavenne(FUN_CRIT = ErrorCrit_KGE, InputsModel = InputsModel, RunOptions = RunOptions, Obs = BasinObs$Qmm[Ind_Run], diff --git a/vignettes/V05_sd_model.Rmd b/vignettes/V05_sd_model.Rmd index f7f4415c9a7108818e36cd91034d4c680b54c633..333284e8c64c30178624ab99c070d74ad36d0a94 100644 --- a/vignettes/V05_sd_model.Rmd +++ b/vignettes/V05_sd_model.Rmd @@ -201,10 +201,10 @@ ParamDownTheo <- c(Velocity, OutputsCalibUp$ParamFinalR) The De Lavenne criterion is initialised with the a priori parameter set and the value of the KGE of the upstream basin. ```{r} -IC_DeLavenne <- CreateInputsCrit_DeLavenne(InputsModel = InputsModelDown2, +IC_Lavenne <- CreateInputsCrit_Lavenne(InputsModel = InputsModelDown2, RunOptions = RunOptionsDown, Obs = QObsDown[Ind_Run], - AprParamR = ParamDownTheo, + AprParamR = ParamDownTheo, AprCrit = OutputsCalibUp$CritFinal) ``` @@ -213,7 +213,7 @@ The De Lavenne criterion is used instead of the KGE for calibration with regular ```{r} OutputsCalibDown3 <- Calibration_Michel(InputsModel = InputsModelDown2, RunOptions = RunOptionsDown, - InputsCrit = IC_DeLavenne, + InputsCrit = IC_Lavenne, CalibOptions = CalibOptionsDown, FUN_MOD = RunModel_GR4J) ``` @@ -238,7 +238,7 @@ Both calibrations overestimate this parameter: ```{r} mVelocity <- matrix(c(Velocity, OutputsCalibDown1$ParamFinalR[1], - OutputsCalibDown2$ParamFinalR[1], + OutputsCalibDown2$ParamFinalR[1], OutputsCalibDown3$ParamFinalR[1]), ncol = 1, dimnames = list(c("theoretical", @@ -251,7 +251,7 @@ knitr::kable(mVelocity) ## Value of the performance criteria with theoretical calibration -Theoretically, the parameters of the downstream GR4J model should be the same as the upstream one with the velocity as extra parameter : +Theoretically, the parameters of the downstream GR4J model should be the same as the upstream one with the velocity as extra parameter : ```{r} OutputsModelDownTheo <- RunModel(InputsModel = InputsModelDown2,