diff options
-rw-r--r-- | DESCRIPTION | 4 | ||||
-rw-r--r-- | NAMESPACE | 1 | ||||
-rw-r--r-- | R/mkinmod.R | 6 | ||||
-rw-r--r-- | check.log | 15 | ||||
-rw-r--r-- | test.log | 51 | ||||
-rw-r--r-- | tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg | 6 | ||||
-rw-r--r-- | tests/testthat/DFOP_FOCUS_C_messages.txt | 4 | ||||
-rw-r--r-- | tests/testthat/FOCUS_2006_D.csf | 2 |
8 files changed, 57 insertions, 32 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index f631a541..5576e5bf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: mkin Type: Package Title: Kinetic Evaluation of Chemical Degradation Data Version: 0.9.49.9 -Date: 2020-03-20 +Date: 2020-03-31 Authors@R: c(person("Johannes", "Ranke", role = c("aut", "cre", "cph"), email = "jranke@uni-bremen.de", comment = c(ORCID = "0000-0003-4371-6538")), @@ -17,7 +17,7 @@ Description: Calculation routines based on the FOCUS Kinetics Report (2006, note that no warranty is implied for correctness of results or fitness for a particular purpose. Imports: stats, graphics, methods, deSolve, R6, inline, parallel, numDeriv, - lmtest + lmtest, pkgbuild Suggests: knitr, rbenchmark, tikzDevice, testthat, rmarkdown, covr, vdiffr, benchmarkme, tibble, stats4 License: GPL @@ -76,6 +76,7 @@ importFrom(methods,signature) importFrom(parallel,detectCores) importFrom(parallel,mclapply) importFrom(parallel,parLapply) +importFrom(pkgbuild,has_compiler) importFrom(stats,AIC) importFrom(stats,BIC) importFrom(stats,aggregate) diff --git a/R/mkinmod.R b/R/mkinmod.R index cf618525..cfd40504 100644 --- a/R/mkinmod.R +++ b/R/mkinmod.R @@ -33,6 +33,7 @@ #' @param verbose If \code{TRUE}, passed to \code{\link{cfunction}} if #' applicable to give detailed information about the C function being built. #' @importFrom methods signature +#' @importFrom pkgbuild has_compiler #' @importFrom inline cfunction #' @return A list of class \code{mkinmod} for use with \code{\link{mkinfit}}, #' containing, among others, @@ -364,8 +365,9 @@ mkinmod <- function(..., use_of_ff = "min", speclist = NULL, quiet = FALSE, verb model$coefmat <- m }#}}} - # Try to create a function compiled from C code if >1 observed variable {{{ - if (length(obs_vars) > 1) { + # Try to create a function compiled from C code there is more than one observed variable {{{ + # and a compiler is available + if (length(obs_vars) > 1 & has_compiler()) { # Translate the R code for the derivatives to C code diffs.C <- paste(diffs, collapse = ";\n") @@ -1,11 +1,11 @@ * using log directory ‘/home/jranke/git/mkin/mkin.Rcheck’ -* using R version 3.6.2 (2019-12-12) +* using R version 3.6.3 (2020-02-29) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using options ‘--no-tests --as-cran’ * checking for file ‘mkin/DESCRIPTION’ ... OK * checking extension type ... Package -* this is package ‘mkin’ version ‘0.9.49.8’ +* this is package ‘mkin’ version ‘0.9.49.9’ * package encoding: UTF-8 * checking CRAN incoming feasibility ... Note_to_CRAN_maintainers Maintainer: ‘Johannes Ranke <jranke@uni-bremen.de>’ @@ -56,7 +56,10 @@ Maintainer: ‘Johannes Ranke <jranke@uni-bremen.de>’ * checking data for ASCII and uncompressed saves ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK -* checking examples ... OK +* checking examples ... NOTE +Examples with CPU or elapsed time > 5s + user system elapsed +mkinsub 2.015 4.083 0.703 * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... SKIPPED * checking for unstated dependencies in vignettes ... OK @@ -66,5 +69,9 @@ Maintainer: ‘Johannes Ranke <jranke@uni-bremen.de>’ * checking for detritus in the temp directory ... OK * DONE -Status: OK +Status: 1 NOTE +See + ‘/home/jranke/git/mkin/mkin.Rcheck/00check.log’ +for details. + @@ -1,38 +1,53 @@ Loading mkin Testing mkin ✔ | OK F W S | Context -✔ | 5 | Calculation of Akaike weights ✔ | 2 | Export dataset for reading into CAKE -✔ | 10 | Confidence intervals and p-values [9.7 s] -✔ | 14 | Error model fitting [36.9 s] -✔ | 4 | Calculation of FOCUS chi2 error levels [2.2 s] -✔ | 13 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [3.3 s] -✔ | 6 | Test fitting the decline of metabolites from their maximum [0.7 s] -✔ | 1 | Fitting the logistic model [0.9 s] +✔ | 13 | Results for FOCUS D established in expertise for UBA (Ranke 2014) [3.8 s] +✔ | 4 | Calculation of FOCUS chi2 error levels [2.3 s] +✔ | 4 | Fitting the SFORB model [1.7 s] +✔ | 5 | Calculation of Akaike weights +✔ | 10 | Confidence intervals and p-values [10.2 s] +✔ | 14 | Error model fitting [40.7 s] +✔ | 6 | Test fitting the decline of metabolites from their maximum [0.8 s] +✔ | 1 | Fitting the logistic model [1.0 s] ✔ | 1 | Test dataset class mkinds used in gmkin -✔ | 12 | Special cases of mkinfit calls [2.4 s] +✖ | 11 1 | Special cases of mkinfit calls [2.3 s] +──────────────────────────────────────────────────────────────────────────────── +test_mkinfit_errors.R:64: failure: We get reproducible output if quiet = FALSE +Results have changed from known value recorded in 'DFOP_FOCUS_C_messages.txt'. +2/165 mismatches +x[84]: "Sum of squared residuals at call 57: 4.364077" +y[84]: "Sum of squared residuals at call 57: 4.364078" + +x[105]: "85.00134 -0.7776046 -4.025878 1.248775 " +y[105]: "85.00135 -0.7776046 -4.025878 1.248775 " +──────────────────────────────────────────────────────────────────────────────── ✔ | 9 | mkinmod model generation and printing [0.2 s] ✔ | 3 | Model predictions with mkinpredict [0.3 s] -✔ | 16 | Evaluations according to 2015 NAFTA guidance [4.1 s] -✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.3 s] +✔ | 16 | Evaluations according to 2015 NAFTA guidance [4.3 s] +✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.2 s] ✔ | 3 | Summary -✔ | 11 | Plotting [0.6 s] +✖ | 10 1 | Plotting [0.6 s] +──────────────────────────────────────────────────────────────────────────────── +test_plots_summary_twa.R:118: failure: Plotting mkinfit and mmkin objects is reproducible +Figures don't match: plot-errmod-with-sfo-lin-a-obs.svg + +──────────────────────────────────────────────────────────────────────────────── ✔ | 4 | AIC calculation ✔ | 2 | Residuals extracted from mkinfit models -✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [5.3 s] -✔ | 4 | Fitting the SFORB model [1.7 s] +✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [5.6 s] ✔ | 1 | Summaries of old mkinfit objects -✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [7.2 s] -✔ | 7 1 | Hypothesis tests [32.3 s] +✔ | 4 | Results for synthetic data established in expertise for UBA (Ranke 2014) [7.4 s] +✔ | 7 1 | Hypothesis tests [33.6 s] ──────────────────────────────────────────────────────────────────────────────── test_tests.R:60: skip: We can do a likelihood ratio test using an update specification Reason: This errors out if called by testthat while it works in a normal R session ──────────────────────────────────────────────────────────────────────────────── ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 110.2 s +Duration: 117.3 s -OK: 138 -Failed: 0 +OK: 136 +Failed: 2 Warnings: 0 Skipped: 1 diff --git a/tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg b/tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg index 2b4930ba..7ba81d7b 100644 --- a/tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg +++ b/tests/figs/plotting/plot-errmod-with-sfo-lin-a-obs.svg @@ -156,7 +156,7 @@ <g clip-path='url(#cpMC4wMHw3MjAuMDB8NTc2LjAwfDAuMDA=)'><text transform='translate(401.76,425.07) rotate(-90)' style='font-size: 12.00px; font-family: Liberation Sans;' textLength='6.67px' lengthAdjust='spacingAndGlyphs'>5</text></g> <g clip-path='url(#cpMC4wMHw3MjAuMDB8NTc2LjAwfDAuMDA=)'><text transform='translate(401.76,364.01) rotate(-90)' style='font-size: 12.00px; font-family: Liberation Sans;' textLength='13.34px' lengthAdjust='spacingAndGlyphs'>10</text></g> <g clip-path='url(#cpMC4wMHw3MjAuMDB8NTc2LjAwfDAuMDA=)'><text transform='translate(401.76,299.61) rotate(-90)' style='font-size: 12.00px; font-family: Liberation Sans;' textLength='13.34px' lengthAdjust='spacingAndGlyphs'>15</text></g> -<g clip-path='url(#cpMC4wMHw3MjAuMDB8NTc2LjAwfDAuMDA=)'><text transform='translate(401.76,235.21) rotate(-90)' style='font-size: 12.00px; font-family: Liberation Sans;' textLength='13.34px' lengthAdjust='spacingAndGlyphs'>20</text></g> +<g clip-path='url(#cpMC4wMHw3MjAuMDB8NTc2LjAwfDAuMDA=)'><text transform='translate(401.76,235.22) rotate(-90)' style='font-size: 12.00px; font-family: Liberation Sans;' textLength='13.34px' lengthAdjust='spacingAndGlyphs'>20</text></g> <g clip-path='url(#cpMC4wMHw3MjAuMDB8NTc2LjAwfDAuMDA=)'><text transform='translate(401.76,170.82) rotate(-90)' style='font-size: 12.00px; font-family: Liberation Sans;' textLength='13.34px' lengthAdjust='spacingAndGlyphs'>25</text></g> <g clip-path='url(#cpMC4wMHw3MjAuMDB8NTc2LjAwfDAuMDA=)'><text transform='translate(401.76,106.42) rotate(-90)' style='font-size: 12.00px; font-family: Liberation Sans;' textLength='13.34px' lengthAdjust='spacingAndGlyphs'>30</text></g> <polyline points='419.04,502.56 689.76,502.56 689.76,59.04 419.04,59.04 419.04,502.56 ' style='stroke-width: 0.75;' clip-path='url(#cpMC4wMHw3MjAuMDB8NTc2LjAwfDAuMDA=)' /> @@ -186,7 +186,7 @@ <circle cx='429.07' cy='328.36' r='2.70pt' style='stroke-width: 0.75;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <polyline points='506.65,446.70 510.29,453.00 503.02,453.00 506.65,446.70 ' style='stroke-width: 0.75; stroke: #FF0000;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <polyline points='506.65,391.22 510.29,397.51 503.02,397.51 506.65,391.22 ' style='stroke-width: 0.75; stroke: #FF0000;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> -<polyline points='517.01,149.17 520.64,155.46 513.37,155.46 517.01,149.17 ' style='stroke-width: 0.75; stroke: #FF0000;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> +<polyline points='517.01,149.17 520.64,155.47 513.37,155.47 517.01,149.17 ' style='stroke-width: 0.75; stroke: #FF0000;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <polyline points='517.01,479.70 520.64,485.99 513.37,485.99 517.01,479.70 ' style='stroke-width: 0.75; stroke: #FF0000;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <polyline points='463.78,479.37 467.42,485.67 460.14,485.67 463.78,479.37 ' style='stroke-width: 0.75; stroke: #FF0000;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <polyline points='463.78,416.53 467.42,422.82 460.14,422.82 463.78,416.53 ' style='stroke-width: 0.75; stroke: #FF0000;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> @@ -222,7 +222,7 @@ <line x1='451.66' y1='486.94' x2='451.66' y2='479.30' style='stroke-width: 0.75; stroke: #00CD00;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <line x1='447.84' y1='480.11' x2='455.47' y2='480.11' style='stroke-width: 0.75; stroke: #00CD00;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <line x1='451.66' y1='483.93' x2='451.66' y2='476.29' style='stroke-width: 0.75; stroke: #00CD00;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> -<line x1='437.55' y1='249.04' x2='445.19' y2='249.04' style='stroke-width: 0.75; stroke: #00CD00;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> +<line x1='437.55' y1='249.05' x2='445.19' y2='249.05' style='stroke-width: 0.75; stroke: #00CD00;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <line x1='441.37' y1='252.86' x2='441.37' y2='245.23' style='stroke-width: 0.75; stroke: #00CD00;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <line x1='437.55' y1='423.26' x2='445.19' y2='423.26' style='stroke-width: 0.75; stroke: #00CD00;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> <line x1='441.37' y1='427.07' x2='441.37' y2='419.44' style='stroke-width: 0.75; stroke: #00CD00;' clip-path='url(#cpNDE5LjA0fDY4OS43Nnw1MDIuNTZ8NTkuMDQ=)' /> diff --git a/tests/testthat/DFOP_FOCUS_C_messages.txt b/tests/testthat/DFOP_FOCUS_C_messages.txt index 78438d06..c36f11db 100644 --- a/tests/testthat/DFOP_FOCUS_C_messages.txt +++ b/tests/testthat/DFOP_FOCUS_C_messages.txt @@ -81,7 +81,7 @@ Sum of squared residuals at call 55: 4.364078 85.01633 -0.7763163 -4.027611 1.248897 Sum of squared residuals at call 56: 4.364078 85.01633 -0.7763164 -4.027611 1.248897 -Sum of squared residuals at call 57: 4.364078 +Sum of squared residuals at call 57: 4.364077 85.01633 -0.7763163 -4.027611 1.248897 85.01633 -0.7763163 -4.027611 1.248897 85.00894 -0.7777917 -4.026307 1.24772 @@ -102,7 +102,7 @@ Sum of squared residuals at call 67: 4.362751 85.00518 -0.7773082 -4.026004 1.248453 85.00134 -0.7776046 -4.025878 1.248775 Sum of squared residuals at call 70: 4.362721 -85.00135 -0.7776046 -4.025878 1.248775 +85.00134 -0.7776046 -4.025878 1.248775 Sum of squared residuals at call 71: 4.362721 85.00134 -0.7776046 -4.025878 1.248775 Sum of squared residuals at call 72: 4.362721 diff --git a/tests/testthat/FOCUS_2006_D.csf b/tests/testthat/FOCUS_2006_D.csf index 358b50e3..a7f8edaf 100644 --- a/tests/testthat/FOCUS_2006_D.csf +++ b/tests/testthat/FOCUS_2006_D.csf @@ -5,7 +5,7 @@ Description: MeasurementUnits: % AR TimeUnits: days Comments: Created using mkin::CAKE_export -Date: 2019-11-13 +Date: 2020-03-31 Optimiser: IRLS [Data] |