diff --git a/tests/testthat/test-vignettes.R b/tests/testthat/test-vignettes.R index f17ee71b0b3b6eb7b9e5b4a784c9e177d3ba5916..7d19c74f1ad2ecefb51218928d45128e19b733af 100644 --- a/tests/testthat/test-vignettes.R +++ b/tests/testthat/test-vignettes.R @@ -15,14 +15,6 @@ test_that("V02.1_param_optim works", { rda_resPORT <- resPORT expect_true(RunVignetteChunks("V02.1_param_optim")) expect_equal(summary(resGLOB), summary(rda_resGLOB), tolerance = 1E-7) - resGLOB <- data.frame(Algo = c("airGR", "PORT", "DE", "PSO", "MA-LS"), - round(rbind( - OutputsCalib$ParamFinalR , - airGR::TransfoParam_GR4J(ParamIn = optPORT$par , Direction = "TR"), - airGR::TransfoParam_GR4J(ParamIn = as.numeric(optDE$optim$bestmem), Direction = "TR"), - rda_resGLOB[4, c("X1", "X2", "X3", "X4")], - airGR::TransfoParam_GR4J(ParamIn = optMALS$sol , Direction = "TR")), - digits = 3)) expect_equal(resGLOB[,-1], rda_resGLOB[,-1], tolerance = 1E-2) # High tolerance due to randomisation in optimisations }) diff --git a/vignettes/V02.1_param_optim.Rmd b/vignettes/V02.1_param_optim.Rmd index c23151e00f2a370c4ea2f3efe82063260cf77450..0063d9151e5c4c90de00a1d61aaa0374ebac4e31 100644 --- a/vignettes/V02.1_param_optim.Rmd +++ b/vignettes/V02.1_param_optim.Rmd @@ -138,7 +138,7 @@ optDE <- DEoptim::DEoptim(fn = OptimGR4J, ## Particle Swarm -```{r, warning=FALSE, results='hide', message=FALSE, eval=FALSE, purl=FALSE} +```{r, warning=FALSE, results='hide', message=FALSE, eval=FALSE} optPSO <- hydroPSO::hydroPSO(fn = OptimGR4J, lower = lowerGR4J, upper = upperGR4J, control = list(write2disk = FALSE, verbose = FALSE)) @@ -155,7 +155,7 @@ optMALS <- Rmalschains::malschains(fn = OptimGR4J, As it can be seen in the table below, the four additional optimization strategies tested lead to very close optima. -```{r, warning=FALSE, echo=FALSE, eval=FALSE, purl=FALSE} +```{r, warning=FALSE, echo=FALSE, eval=FALSE} resGLOB <- data.frame(Algo = c("airGR", "PORT", "DE", "PSO", "MA-LS"), round(rbind( OutputsCalib$ParamFinalR ,