From 501bb6d045208a1ba7b125d53cc60ed7f376358d Mon Sep 17 00:00:00 2001 From: Jared Knowles Date: Fri, 6 Nov 2026 15:47:04 -0500 Subject: [PATCH] test(quality): accept the GLMM snapshot for lme4 2.1-0 (#142) lme4 2.1-0 refreshes the PIRLS weights before the Laplace approximation, which moves this fit slightly: deviance 73.4743 to 73.4715, in 238 optimizer evaluations rather than 285. In one Linux container, 2.0-1 and 2.0-6 reproduce the old snapshot and 2.1-0 the new one, so merTools itself did not change. The test now skips on an older lme4. Closes #142 Co-Authored-By: Claude Opus 5.5 --- .../_snaps/predictInterval-snapshot.md | 18 +++++++++--------- tests/testthat/test-predictInterval-snapshot.R | 3 +++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/tests/testthat/_snaps/predictInterval-snapshot.md b/tests/testthat/_snaps/predictInterval-snapshot.md index 0b5bea2..a5ff304 100644 --- a/tests/testthat/_snaps/predictInterval-snapshot.md +++ b/tests/testthat/_snaps/predictInterval-snapshot.md @@ -513,17 +513,17 @@ { "type": "double", "attributes": {}, - "value": [-0.81774221, -1.79044934, -1.92783529, -2.40058996, -1.68674581] + "value": [-0.81855413, -1.79161255, -1.93038716, -2.39945816, -1.68673972] }, { "type": "double", "attributes": {}, - "value": [-0.24839809, -1.17244634, -1.26060618, -1.67449735, -1.140145] + "value": [-0.24811107, -1.17023982, -1.25716183, -1.67223365, -1.13933899] }, { "type": "double", "attributes": {}, - "value": [-1.36331829, -2.39968607, -2.56193069, -3.12293917, -2.25913345] + "value": [-1.36276013, -2.40342038, -2.56287702, -3.12879128, -2.25853488] } ] } @@ -553,17 +553,17 @@ { "type": "double", "attributes": {}, - "value": [0.30624314, 0.14301764, 0.12699037, 0.08312772, 0.15620428] + "value": [0.30607066, 0.14287513, 0.12670773, 0.08321402, 0.15620508] }, { "type": "double", "attributes": {}, - "value": [0.43821782, 0.23641308, 0.22086956, 0.15782549, 0.24229374] + "value": [0.43828848, 0.23681164, 0.22146285, 0.1581266, 0.24244174] }, { "type": "double", "attributes": {}, - "value": [0.20370152, 0.08319664, 0.07162905, 0.04217089, 0.09456454] + "value": [0.20379208, 0.08291225, 0.07156614, 0.04193514, 0.0946158] } ] } @@ -593,17 +593,17 @@ { "type": "double", "attributes": {}, - "value": [-0.81774221, -1.79044934, -1.92783529, -2.40058996, -1.68674581] + "value": [-0.81855413, -1.79161255, -1.93038716, -2.39945816, -1.68673972] }, { "type": "double", "attributes": {}, - "value": [-0.24839809, -1.17244634, -1.26060618, -1.67449735, -1.140145] + "value": [-0.24811107, -1.17023982, -1.25716183, -1.67223365, -1.13933899] }, { "type": "double", "attributes": {}, - "value": [-1.36331829, -2.39968607, -2.56193069, -3.12293917, -2.25913345] + "value": [-1.36276013, -2.40342038, -2.56287702, -3.12879128, -2.25853488] } ] } diff --git a/tests/testthat/test-predictInterval-snapshot.R b/tests/testthat/test-predictInterval-snapshot.R index 256f01e..39860e4 100644 --- a/tests/testthat/test-predictInterval-snapshot.R +++ b/tests/testthat/test-predictInterval-snapshot.R @@ -151,6 +151,9 @@ test_that("LMM: single-row newdata and variance-adjustment options are stable", test_that("GLMM binomial: predictInterval output is stable", { snapshot_platform_ok() + # lme4 2.1-0 refreshes the PIRLS weights before the Laplace approximation, which moves + # this fit slightly (deviance 73.4743 to 73.4715), so the snapshot needs at least that. + skip_if(packageVersion("lme4") < "2.1.0", "snapshot taken with lme4 2.1-0") data(cbpp, package = "lme4") m <- suppressMessages(