From c74b79c983fe9fc872bac1262040e82f16049477 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Wed, 21 Apr 2021 13:11:47 +0200 Subject: Version 1.0.4 published yesterday --- DESCRIPTION | 2 +- NEWS.md | 2 + R/mmkin.R | 5 +- check.log | 8 +- docs/news/index.html | 1 + docs/pkgdown.yml | 2 +- docs/reference/Rplot001.png | Bin 1011 -> 27637 bytes docs/reference/Rplot002.png | Bin 16524 -> 59394 bytes docs/reference/Rplot003.png | Bin 15401 -> 33192 bytes docs/reference/Rplot004.png | Bin 10689 -> 23509 bytes docs/reference/Rplot005.png | Bin 19483 -> 23509 bytes docs/reference/Rplot006.png | Bin 24302 -> 22129 bytes docs/reference/mmkin-1.png | Bin 111569 -> 110844 bytes docs/reference/mmkin-2.png | Bin 108319 -> 107612 bytes docs/reference/mmkin-3.png | Bin 96596 -> 96248 bytes docs/reference/mmkin-4.png | Bin 67345 -> 66653 bytes docs/reference/mmkin-5.png | Bin 65269 -> 65046 bytes docs/reference/mmkin.html | 9 +- docs/reference/nlme-1.png | Bin 70276 -> 70244 bytes docs/reference/plot.mixed.mmkin-1.png | Bin 85433 -> 84976 bytes man/mmkin.Rd | 5 +- test.log | 43 +++++---- ...ot-for-focus-c-with-residuals-like-in-gmkin.svg | 42 ++++----- .../mkinfit-plot-for-focus-c-with-sep-true.svg | 42 ++++----- tests/figs/plotting/plot-res-for-focus-c.svg | 42 ++++----- tests/figs/plotting/plot-res-for-focus-d.svg | 98 ++++++++++----------- 26 files changed, 158 insertions(+), 143 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 176c3039..f5b7f070 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data Version: 1.0.4 -Date: 2021-02-24 +Date: 2021-04-20 Authors@R: c( person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de", diff --git a/NEWS.md b/NEWS.md index 9d03fa3d..88509b66 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,8 @@ - '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 + # mkin 1.0.3 (2021-02-15) - Review and update README, the 'Introduction to mkin' vignette and some of the help pages diff --git a/R/mmkin.R b/R/mmkin.R index 030fb27b..fe04129e 100644 --- a/R/mmkin.R +++ b/R/mmkin.R @@ -13,7 +13,8 @@ #' 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 [parallel::detectCores()] are used. +#' detected by [parallel::detectCores()] are used, except on Windows where +#' the default is 1. #' @param cluster A cluster as returned by \code{\link{makeCluster}} to be used #' for parallel execution. #' @param \dots Further arguments that will be passed to \code{\link{mkinfit}}. @@ -75,7 +76,7 @@ #' #' @export mmkin mmkin <- function(models = c("SFO", "FOMC", "DFOP"), datasets, - cores = parallel::detectCores(), cluster = NULL, ...) + cores = if (Sys.info()["sysname"] == "Windows") 1 else parallel::detectCores(), cluster = NULL, ...) { call <- match.call() parent_models_available = c("SFO", "FOMC", "DFOP", "HS", "SFORB", "IORE", "logistic") diff --git a/check.log b/check.log index 0d04e05e..b848a900 100644 --- a/check.log +++ b/check.log @@ -1,5 +1,5 @@ * using log directory ‘/home/jranke/git/mkin/mkin.Rcheck’ -* using R version 4.0.4 (2021-02-15) +* using R version 4.0.5 (2021-03-31) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-tests --as-cran’ @@ -43,7 +43,9 @@ The Date field is over a month old. * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK -* checking R code for possible problems ... OK +* checking R code for possible problems ... NOTE +mmkin: possible error in Sys.info("sysname"): unused argument + ("sysname") * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK @@ -69,7 +71,7 @@ The Date field is over a month old. * checking for detritus in the temp directory ... OK * DONE -Status: 1 NOTE +Status: 2 NOTEs See ‘/home/jranke/git/mkin/mkin.Rcheck/00check.log’ for details. diff --git a/docs/news/index.html b/docs/news/index.html index fae6503a..2905c120 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -147,6 +147,7 @@
diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index df454e62..3f97ea94 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -10,7 +10,7 @@ articles: web_only/NAFTA_examples: NAFTA_examples.html web_only/benchmarks: benchmarks.html web_only/compiled_models: compiled_models.html -last_built: 2021-03-31T17:15Z +last_built: 2021-04-20T14:34Z urls: reference: https://pkgdown.jrwb.de/mkin/reference article: https://pkgdown.jrwb.de/mkin/articles diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png index 17a35806..49fb9af1 100644 Binary files a/docs/reference/Rplot001.png and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/Rplot002.png b/docs/reference/Rplot002.png index 808f1968..745d583d 100644 Binary files a/docs/reference/Rplot002.png and b/docs/reference/Rplot002.png differ diff --git a/docs/reference/Rplot003.png b/docs/reference/Rplot003.png index 97f650e2..eba202e9 100644 Binary files a/docs/reference/Rplot003.png and b/docs/reference/Rplot003.png differ diff --git a/docs/reference/Rplot004.png b/docs/reference/Rplot004.png index 21ad6783..a4f878c8 100644 Binary files a/docs/reference/Rplot004.png and b/docs/reference/Rplot004.png differ diff --git a/docs/reference/Rplot005.png b/docs/reference/Rplot005.png index 4828f5b2..a4f878c8 100644 Binary files a/docs/reference/Rplot005.png and b/docs/reference/Rplot005.png differ diff --git a/docs/reference/Rplot006.png b/docs/reference/Rplot006.png index 4aed2c87..ff8a5d83 100644 Binary files a/docs/reference/Rplot006.png and b/docs/reference/Rplot006.png differ diff --git a/docs/reference/mmkin-1.png b/docs/reference/mmkin-1.png index 26586ab9..f6bb2131 100644 Binary files a/docs/reference/mmkin-1.png and b/docs/reference/mmkin-1.png differ diff --git a/docs/reference/mmkin-2.png b/docs/reference/mmkin-2.png index dbcdd8ee..50102a3d 100644 Binary files a/docs/reference/mmkin-2.png and b/docs/reference/mmkin-2.png differ diff --git a/docs/reference/mmkin-3.png b/docs/reference/mmkin-3.png index 80245fc6..9aa7f0db 100644 Binary files a/docs/reference/mmkin-3.png and b/docs/reference/mmkin-3.png differ diff --git a/docs/reference/mmkin-4.png b/docs/reference/mmkin-4.png index 328aa564..f4f413d1 100644 Binary files a/docs/reference/mmkin-4.png and b/docs/reference/mmkin-4.png differ diff --git a/docs/reference/mmkin-5.png b/docs/reference/mmkin-5.png index 9ce5e919..48ab2c50 100644 Binary files a/docs/reference/mmkin-5.png and b/docs/reference/mmkin-5.png differ diff --git a/docs/reference/mmkin.html b/docs/reference/mmkin.html index c73d14bf..caba300e 100644 --- a/docs/reference/mmkin.html +++ b/docs/reference/mmkin.html @@ -155,7 +155,7 @@ datasets specified in its first two arguments.

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 for mkinfit.

is only used when the cluster argument is NULL. On Windows machines, cores > 1 is not supported, you need to use the cluster argument to use multiple logical processors. Per default, all cores -detected by parallel::detectCores() are used.

+detected by parallel::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.864
time_1 +#> 4.656 0.403 1.734
time_1
#> user system elapsed -#> 5.786 0.008 5.794
+#> 5.627 0.004 5.631
endpoints(fits.0[["SFO_lin", 2]])
#> $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.1