From 297285ac86a74c1ceb517aac9eca46d07513c45d Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Fri, 23 Jul 2021 15:43:02 +0200 Subject: Rerun tests, use current vdiffr on travis --- .travis.yml | 1 + GNUmakefile | 3 -- test.log | 42 ++++++------------------ vignettes/FOCUS_D.html | 14 ++++---- vignettes/mkin.html | 88 +++++++++++++++++++++++--------------------------- vignettes/twa.html | 2 +- 6 files changed, 58 insertions(+), 92 deletions(-) diff --git a/.travis.yml b/.travis.yml index b1210c6a..e64c9dca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ r_packages: - nlme - devtools - covr + - vdiffr r_github_packages: - saemixdevelopment/saemixextension@master script: diff --git a/GNUmakefile b/GNUmakefile index 8604d3b3..a6abacac 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -90,9 +90,6 @@ slowtests: install NOT_CRAN=true "$(RBIN)/Rscript" -e 'library(mkin); testthat::test_dir("tests/testthat/slow")' 2>&1 | tee tests_slow.log sed -i -e "s/\r.*\r//" tests_slow.log -vdiffr: - "$(RBIN)/Rscript" -e 'vdiffr::manage_cases(filter = "plot|nafta")' - testcheck: roxygen test check README.html: README.md diff --git a/test.log b/test.log index a8b42364..1f477869 100644 --- a/test.log +++ b/test.log @@ -3,11 +3,11 @@ Loading required package: parallel ℹ Testing mkin ✔ | OK F W S | Context ✔ | 5 | AIC calculation -✔ | 5 | Analytical solutions for coupled models [3.2 s] +✔ | 5 | Analytical solutions for coupled models [3.1 s] ✔ | 5 | Calculation of Akaike weights ✔ | 2 | Export dataset for reading into CAKE ✔ | 12 | Confidence intervals and p-values [1.3 s] -✔ | 14 | Error model fitting [4.3 s] +✔ | 14 | Error model fitting [4.2 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] @@ -19,43 +19,19 @@ Loading required package: parallel ✔ | 1 | mkinfit features [0.3 s] ✔ | 8 | mkinmod model generation and printing [0.2 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 -Figures don't match: mkinfit-plot-for-focus-c-with-residuals-like-in-gmkin.svg - - -Failure (test_plot.R:21:3): Plotting mkinfit, mmkin and mixed model objects is reproducible -Figures don't match: plot-res-for-focus-c.svg - - -Failure (test_plot.R:22:3): Plotting mkinfit, mmkin and mixed model objects is reproducible -Figures don't match: mkinfit-plot-for-focus-c-with-sep-true.svg - - -Failure (test_plot.R:30:3): Plotting mkinfit, mmkin and mixed model objects is reproducible -Figures don't match: plot-res-for-focus-d.svg - -──────────────────────────────────────────────────────────────────────────────── +✔ | 16 | Evaluations according to 2015 NAFTA guidance [1.4 s] +✔ | 9 | Nonlinear mixed-effects models [7.9 s] +✔ | 14 | Plotting [1.1 s] ✔ | 4 | Residuals extracted from mkinfit models ✔ | 2 | Complex test case from Schaefer et al. (2007) Piacenza paper [1.5 s] -✔ | 7 | Fitting the SFORB model [3.6 s] +✔ | 7 | Fitting the SFORB model [3.7 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.1 s] +✔ | 9 | Hypothesis tests [8.0 s] ✔ | 4 | Calculation of maximum time weighted average concentrations (TWAs) [2.4 s] ══ Results ═════════════════════════════════════════════════════════════════════ -Duration: 35.2 s +Duration: 40.3 s -[ FAIL 5 | WARN 0 | SKIP 0 | PASS 168 ] +[ FAIL 0 | WARN 0 | SKIP 0 | PASS 174 ] diff --git a/vignettes/FOCUS_D.html b/vignettes/FOCUS_D.html index f740cfc0..c2599ee5 100644 --- a/vignettes/FOCUS_D.html +++ b/vignettes/FOCUS_D.html @@ -363,7 +363,7 @@ pre code {

Example evaluation of FOCUS Example Dataset D

Johannes Ranke

-

Last change 31 January 2019 (rebuilt 2021-03-31)

+

Last change 31 January 2019 (rebuilt 2021-07-23)

@@ -431,16 +431,16 @@ print(FOCUS_2006_D) ## of zero were removed from the data

A plot of the fit including a residual plot for both observed variables is obtained using the plot_sep method for mkinfit objects, which shows separate graphs for all compounds and their residuals.

plot_sep(fit, lpos = c("topright", "bottomright"))
-

+

Confidence intervals for the parameter estimates are obtained using the mkinparplot function.

mkinparplot(fit)

A comprehensive report of the results is obtained using the summary method for mkinfit objects.

summary(fit)
-
## mkin version used for fitting:    1.0.4 
-## R version used for fitting:       4.0.4 
-## Date of fit:     Wed Mar 31 19:01:35 2021 
-## Date of summary: Wed Mar 31 19:01:35 2021 
+
## mkin version used for fitting:    1.1.0 
+## R version used for fitting:       4.1.0 
+## Date of fit:     Fri Jul 23 15:39:43 2021 
+## Date of summary: Fri Jul 23 15:39:43 2021 
 ## 
 ## Equations:
 ## d_parent/dt = - k_parent * parent
@@ -448,7 +448,7 @@ print(FOCUS_2006_D)
## ## Model predictions using solution type analytical ## -## Fitted using 401 model solutions performed in 0.146 s +## Fitted using 401 model solutions performed in 0.152 s ## ## Error model: Constant variance ## diff --git a/vignettes/mkin.html b/vignettes/mkin.html index 3a49375a..4afe6afd 100644 --- a/vignettes/mkin.html +++ b/vignettes/mkin.html @@ -60,6 +60,15 @@ if (!!window.navigator.userAgent.match("MSIE 8")) { !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b + @@ -1776,6 +1765,9 @@ $(document).ready(function () {