From 5364f037a72863ef5ba81e14ba4417f68fd389f9 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 18 Nov 2022 19:14:47 +0100 Subject: Make mixed model test data permanent to ensure reproducibility To ensure that tests on different platforms work on the same data, the mixed modelling test data previosly generated in tests/testthat/setup_script.R were generated once using the script in inst/dataset/generation/ds_mixed.R, and are now distributed with the package. --- tests/testthat/test_plot.R | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'tests/testthat/test_plot.R') diff --git a/tests/testthat/test_plot.R b/tests/testthat/test_plot.R index 13058c00..01b0c1ee 100644 --- a/tests/testthat/test_plot.R +++ b/tests/testthat/test_plot.R @@ -44,24 +44,24 @@ test_that("Plotting mkinfit, mmkin and mixed model objects is reproducible", { f_uba_dfop_sfo_saem <- saem(f_uba_mmkin["DFOP-SFO", ], quiet = TRUE, transformations = "saemix") - plot_biphasic_mmkin <- function() plot(f_uba_dfop_sfo_mixed, pop_curve = TRUE) - vdiffr::expect_doppelganger("mixed model fit for mmkin object", plot_biphasic_mmkin) + plot_dfop_sfo_mmkin <- function() plot(f_uba_dfop_sfo_mixed, pop_curve = TRUE) + vdiffr::expect_doppelganger("mixed model fit for mmkin object", plot_dfop_sfo_mmkin) - plot_biphasic_saem_s <- function() plot(f_uba_dfop_sfo_saem) - vdiffr::expect_doppelganger("mixed model fit for saem object with saemix transformations", plot_biphasic_saem_s) + plot_dfop_sfo_saem_s <- function() plot(f_uba_dfop_sfo_saem) + vdiffr::expect_doppelganger("mixed model fit for saem object with saemix transformations", plot_dfop_sfo_saem_s) skip_on_travis() - plot_biphasic_nlme <- function() plot(dfop_nlme_1) - vdiffr::expect_doppelganger("mixed model fit for nlme object", plot_biphasic_nlme) + plot_dfop_sfo_nlme <- function() plot(dfop_nlme_1) + vdiffr::expect_doppelganger("mixed model fit for nlme object", plot_dfop_sfo_nlme) - #plot_biphasic_mmkin <- function() plot(mixed(mmkin_biphasic)) + #plot_dfop_sfo_mmkin <- function() plot(mixed(mmkin_dfop_sfo)) # Biphasic fits with lots of data and fits have lots of potential for differences - plot_biphasic_nlme <- function() plot(nlme_biphasic) - #plot_biphasic_saem_s <- function() plot(saem_biphasic_s) - plot_biphasic_saem_m <- function() plot(saem_biphasic_m) + plot_dfop_sfo_nlme <- function() plot(nlme_dfop_sfo) + #plot_dfop_sfo_saem_s <- function() plot(saem_dfop_sfo_s) + plot_dfop_sfo_saem_m <- function() plot(saem_dfop_sfo_m) - vdiffr::expect_doppelganger("mixed model fit for saem object with mkin transformations", plot_biphasic_saem_m) + vdiffr::expect_doppelganger("mixed model fit for saem object with mkin transformations", plot_dfop_sfo_saem_m) # different results when working with eigenvalues plot_errmod_fit_D_obs_eigen <- function() plot_err(fit_D_obs_eigen, sep_obs = FALSE) -- cgit v1.2.1 From 5ec8e1bad1aa7d79ee9c19bdd50be07f81a14278 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 18 Nov 2022 22:11:02 +0100 Subject: Move two saem fits from setup script to skipped tests Save winbuilder/CRAN check time... --- tests/testthat/test_plot.R | 4 ---- 1 file changed, 4 deletions(-) (limited to 'tests/testthat/test_plot.R') diff --git a/tests/testthat/test_plot.R b/tests/testthat/test_plot.R index 01b0c1ee..f5da5982 100644 --- a/tests/testthat/test_plot.R +++ b/tests/testthat/test_plot.R @@ -41,7 +41,6 @@ test_that("Plotting mkinfit, mmkin and mixed model objects is reproducible", { f_uba_mmkin <- mmkin(list("DFOP-SFO" = dfop_sfo_uba), ds_uba, quiet = TRUE, cores = n_cores) f_uba_dfop_sfo_mixed <- mixed(f_uba_mmkin["DFOP-SFO", ]) - f_uba_dfop_sfo_saem <- saem(f_uba_mmkin["DFOP-SFO", ], quiet = TRUE, transformations = "saemix") plot_dfop_sfo_mmkin <- function() plot(f_uba_dfop_sfo_mixed, pop_curve = TRUE) @@ -59,9 +58,6 @@ test_that("Plotting mkinfit, mmkin and mixed model objects is reproducible", { # Biphasic fits with lots of data and fits have lots of potential for differences plot_dfop_sfo_nlme <- function() plot(nlme_dfop_sfo) #plot_dfop_sfo_saem_s <- function() plot(saem_dfop_sfo_s) - plot_dfop_sfo_saem_m <- function() plot(saem_dfop_sfo_m) - - vdiffr::expect_doppelganger("mixed model fit for saem object with mkin transformations", plot_dfop_sfo_saem_m) # different results when working with eigenvalues plot_errmod_fit_D_obs_eigen <- function() plot_err(fit_D_obs_eigen, sep_obs = FALSE) -- cgit v1.2.1