From 3a5463672c297b37c3c9135c8b144c48744c05d0 Mon Sep 17 00:00:00 2001
From: Johannes Ranke
All plotting functions setting graphical parameters: Use on.exit() for resetting graphical parameters
‘plot.mkinfit’: Use xlab and xlim for the residual plot if show_residuals is TRUE
‘mmkin’: Use cores = 1 per default on Windows to make it easier for first time users
mmkin( models = c("SFO", "FOMC", "DFOP"), datasets, - cores = parallel::detectCores(), + cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(), cluster = NULL, ... ) @@ -183,7 +183,8 @@ data formkinfit. is only used when theclusterargument isNULL. On Windows machines, cores > 1 is not supported, you need to use theclusterargument to use multiple logical processors. Per default, all cores -detected byparallel::detectCores()are used. +detected byparallel::detectCores()are used, except on Windows where +the default is 1.cluster @@ -234,9 +235,9 @@ plotting. time_default#> user system elapsed -#> 5.387 0.413 1.864time_1 +#> 4.656 0.403 1.734time_1#> user system elapsed -#> 5.786 0.008 5.794+#> 5.627 0.004 5.631#> $ff #> parent_M1 parent_sink M1_M2 M1_sink diff --git a/docs/reference/nlme-1.png b/docs/reference/nlme-1.png index cca4ce0a..c41adc27 100644 Binary files a/docs/reference/nlme-1.png and b/docs/reference/nlme-1.png differ diff --git a/docs/reference/plot.mixed.mmkin-1.png b/docs/reference/plot.mixed.mmkin-1.png index 2224d96e..65660abe 100644 Binary files a/docs/reference/plot.mixed.mmkin-1.png and b/docs/reference/plot.mixed.mmkin-1.png differ diff --git a/man/mmkin.Rd b/man/mmkin.Rd index 170ce8df..309761dd 100644 --- a/man/mmkin.Rd +++ b/man/mmkin.Rd @@ -9,7 +9,7 @@ more datasets} mmkin( models = c("SFO", "FOMC", "DFOP"), datasets, - cores = parallel::detectCores(), + cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(), cluster = NULL, ... ) @@ -28,7 +28,8 @@ data for \code{\link{mkinfit}}.} is only used when the \code{cluster} argument is \code{NULL}. On Windows machines, cores > 1 is not supported, you need to use the \code{cluster} argument to use multiple logical processors. Per default, all cores -detected by \code{\link[parallel:detectCores]{parallel::detectCores()}} are used.} +detected by \code{\link[parallel:detectCores]{parallel::detectCores()}} are used, except on Windows where +the default is 1.} \item{cluster}{A cluster as returned by \code{\link{makeCluster}} to be used for parallel execution.} diff --git a/test.log b/test.log index b49088e5..a8b42364 100644 --- a/test.log +++ b/test.log @@ -1,27 +1,33 @@ -Loading mkin +ℹ Loading mkin Loading required package: parallel -Testing mkin +ℹ Testing mkin ✔ | OK F W S | Context ✔ | 5 | AIC calculation -✔ | 2 | Export dataset for reading into CAKE -✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [1.0 s] -✔ | 4 | Calculation of FOCUS chi2 error levels [0.5 s] -✔ | 7 | Fitting the SFORB model [3.5 s] -✔ | 5 | Analytical solutions for coupled models [3.1 s] +✔ | 5 | Analytical solutions for coupled models [3.2 s] ✔ | 5 | Calculation of Akaike weights -✔ | 12 | Confidence intervals and p-values [1.0 s] -✔ | 14 | Error model fitting [4.2 s] +✔ | 2 | Export dataset for reading into CAKE +✔ | 12 | Confidence intervals and p-values [1.3 s] +✔ | 14 | Error model fitting [4.3 s] ✔ | 5 | Time step normalisation +✔ | 4 | Calculation of FOCUS chi2 error levels [0.5 s] +✔ | 14 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [0.7 s] ✔ | 4 | Test fitting the decline of metabolites from their maximum [0.3 s] ✔ | 1 | Fitting the logistic model [0.2 s] ✔ | 5 | Nonlinear mixed-effects models [0.1 s] ✔ | 2 | Test dataset classes mkinds and mkindsg -✔ | 1 | mkinfit features [0.3 s] ✔ | 10 | Special cases of mkinfit calls [0.3 s] +✔ | 1 | mkinfit features [0.3 s] ✔ | 8 | mkinmod model generation and printing [0.2 s] -✔ | 3 | Model predictions with mkinpredict [0.4 s] -✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.6 s] -✔ | 9 | Nonlinear mixed-effects models [7.9 s] +✔ | 3 | Model predictions with mkinpredict [0.3 s] +✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.7 s] +✖ | 7 1 | Nonlinear mixed-effects models [1.9 s] +──────────────────────────────────────────────────────────────────────────────── +Error (test_nlme.R:116:3): nlme_function works correctly in other cases +Error: unused argument ("sysname") +Backtrace: + 1. mkin::mmkin("SFO", ds_me_sfo_5, quiet = TRUE) test_nlme.R:116:2 + 2. parallel::mclapply(...) /home/jranke/git/mkin/R/mmkin.R:118:4 +──────────────────────────────────────────────────────────────────────────────── ✖ | 10 4 | Plotting [1.7 s] ──────────────────────────────────────────────────────────────────────────────── Failure (test_plot.R:20:3): Plotting mkinfit, mmkin and mixed model objects is reproducible @@ -42,13 +48,14 @@ Figures don't match: plot-res-for-focus-d.svg ──────────────────────────────────────────────────────────────────────────────── ✔ | 4 | Residuals extracted from mkinfit models ✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.5 s] -✔ | 4 | Summary [0.1 s] +✔ | 7 | Fitting the SFORB model [3.6 s] ✔ | 1 | Summaries of old mkinfit objects +✔ | 4 | Summary [0.1 s] ✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [2.2 s] -✔ | 9 | Hypothesis tests [8.3 s] -✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.5 s] +✔ | 9 | Hypothesis tests [8.1 s] +✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.4 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 41.0 s +Duration: 35.2 s -[ FAIL 4 | WARN 0 | SKIP 0 | PASS 170 ] +[ FAIL 5 | WARN 0 | SKIP 0 | PASS 168 ] diff --git a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg index a84e170d..bef1556f 100644 --- a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg +++ b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg @@ -75,21 +75,21 @@- + - - - - - - + + + + + + - 0 - 20 - 40 - 60 - 80 - 100 + 120 + 20 + 40 + 60 + 80 + 100 120 @@ -115,14 +115,14 @@ - - - - - - - - + + + + + + + + - diff --git a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-sep-true.svg b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-sep-true.svg index 9b16c583..54f0e961 100644 --- a/tests/figs/plotting/mkinfit-plot-for-focus-c-with-sep-true.svg +++ b/tests/figs/plotting/mkinfit-plot-for-focus-c-with-sep-true.svg @@ -86,21 +86,21 @@ + - - - - - - + + + + + + - 0 - 20 - 40 - 60 - 80 - 100 + 120 + 20 + 40 + 60 + 80 + 100 120 @@ -126,14 +126,14 @@ - - - - - - - - + + + + + + + + - diff --git a/tests/figs/plotting/plot-res-for-focus-c.svg b/tests/figs/plotting/plot-res-for-focus-c.svg index 226d9014..3e6de1ce 100644 --- a/tests/figs/plotting/plot-res-for-focus-c.svg +++ b/tests/figs/plotting/plot-res-for-focus-c.svg @@ -75,21 +75,21 @@ + - - - - - - + + + + + + - 0 - 20 - 40 - 60 - 80 - 100 + 120 + 20 + 40 + 60 + 80 + 100 120 @@ -115,14 +115,14 @@ - - - - - - - - + + + + + + + + - diff --git a/tests/figs/plotting/plot-res-for-focus-d.svg b/tests/figs/plotting/plot-res-for-focus-d.svg index 6504365c..222d85f6 100644 --- a/tests/figs/plotting/plot-res-for-focus-d.svg +++ b/tests/figs/plotting/plot-res-for-focus-d.svg @@ -110,21 +110,21 @@ + - - - - - - + + + + + + - 0 - 20 - 40 - 60 - 80 - 100 + 120 + 20 + 40 + 60 + 80 + 100 120 @@ -151,42 +151,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3