From 0656b11931de377662d6aa0bcee95d93cec4bfb4 Mon Sep 17 00:00:00 2001 From: Dorchies David <david.dorchies@inrae.fr> Date: Mon, 25 Jul 2022 11:58:27 +0200 Subject: [PATCH] refactor: remove unecessary lines --- R/Calibration.GRiwrmInputsModel.R | 12 ------------ tests/testthat/helper_RunModel.R | 1 - vignettes/V02_Calibration_SD_model.Rmd | 1 - vignettes/V03_Open-loop_influenced_flow.Rmd | 1 - 4 files changed, 15 deletions(-) diff --git a/R/Calibration.GRiwrmInputsModel.R b/R/Calibration.GRiwrmInputsModel.R index 0ea852e..6051d39 100644 --- a/R/Calibration.GRiwrmInputsModel.R +++ b/R/Calibration.GRiwrmInputsModel.R @@ -202,18 +202,6 @@ updateParameters4Ungauged <- function(GaugedId, return(list(InputsModel = InputsModel, RunOptions = RunOptions)) } -updateRunOptions4Ungauged <- function(id, RunOptions) { - # Remove nodes outside of reduced network - RunOptions <- lapply(RunOptions, function(RO) { - if(RO$id %in% g$id) { - IM - } else { - NULL - } - }) - return(RunOptions) -} - #' RunModel for a sub-network of ungauged nodes #' diff --git a/tests/testthat/helper_RunModel.R b/tests/testthat/helper_RunModel.R index fa1265a..2b5b500 100644 --- a/tests/testthat/helper_RunModel.R +++ b/tests/testthat/helper_RunModel.R @@ -36,7 +36,6 @@ setupRunModel <- if(is.null(griwrm)) { nodes <- Severn$BasinsInfo[, c("gauge_id", "downstream_id", "distance_downstream", "area")] - nodes$distance_downstream <- nodes$distance_downstream nodes$model <- "RunModel_GR4J" griwrm <- CreateGRiwrm(nodes, diff --git a/vignettes/V02_Calibration_SD_model.Rmd b/vignettes/V02_Calibration_SD_model.Rmd index 739edba..dbcf51e 100644 --- a/vignettes/V02_Calibration_SD_model.Rmd +++ b/vignettes/V02_Calibration_SD_model.Rmd @@ -44,7 +44,6 @@ The method used for producing the `GRiwrmInputsModel` object is detailed in the ```{r} data(Severn) nodes <- Severn$BasinsInfo[, c("gauge_id", "downstream_id", "distance_downstream", "area")] -nodes$distance_downstream <- nodes$distance_downstream nodes$model <- "RunModel_GR4J" griwrm <- CreateGRiwrm(nodes, list(id = "gauge_id", down = "downstream_id", length = "distance_downstream")) BasinsObs <- Severn$BasinsObs diff --git a/vignettes/V03_Open-loop_influenced_flow.Rmd b/vignettes/V03_Open-loop_influenced_flow.Rmd index 88f97fe..33ed785 100644 --- a/vignettes/V03_Open-loop_influenced_flow.Rmd +++ b/vignettes/V03_Open-loop_influenced_flow.Rmd @@ -51,7 +51,6 @@ The creation of the `GRiwrm` object is detailed in the vignette "V01_Structure_S ```{r} data(Severn) nodes <- Severn$BasinsInfo[, c("gauge_id", "downstream_id", "distance_downstream", "area")] -nodes$distance_downstream <- nodes$distance_downstream nodes$model <- "RunModel_GR4J" ``` -- GitLab