Skip to content

Commit f0ce52e

Browse files
author
Florence Bockting
committed
chore: remove tests that require brms and also brms dependency in Suggests
1 parent 8693d43 commit f0ce52e

3 files changed

Lines changed: 3 additions & 69 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Authors@R: c(person("Jonah", "Gabry", role = c("aut", "cre"), email = "jgabry@gm
1111
person("Frank", "Weber", role = "ctb"),
1212
person("Eduardo", "Coronado Sroka", role = "ctb"),
1313
person("Teemu", "Sailynoja", role = "ctb"),
14-
person("Aki", "Vehtari", role = "ctb"),
15-
person("Behram", "Ulukır", role = "ctb"),
14+
person("Aki", "Vehtari", role = "ctb"),
15+
person("Behram", "Ulukır", role = "ctb"),
1616
person("Visruth", "Srimath Kandali", role = "ctb"),
1717
person("Mattan S.", "Ben-Shachar", role = "ctb"))
1818
Maintainer: Jonah Gabry <jgabry@gmail.com>
@@ -45,7 +45,6 @@ Imports:
4545
tidyselect,
4646
utils
4747
Suggests:
48-
brms (>= 2.23.0),
4948
cmdstanr,
5049
ggdist,
5150
ggfortify,

tests/testthat/test-ppc-distributions.R

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -941,34 +941,4 @@ testthat::test_that("ppc_pit_ecdf takes correct PIT computation branch", {
941941
),
942942
regexp = "\\[PIT BRANCH\\] Pre-supplied PIT"
943943
)
944-
})
945-
946-
test_that("ppc_pit_ecdf works with pareto_pit method", {
947-
skip_on_cran()
948-
skip_if_not_installed("brms")
949-
skip_if_not_installed("rstanarm")
950-
951-
data("roaches", package = "rstanarm")
952-
roaches$sqrt_roach1 <- sqrt(roaches$roach1)
953-
954-
fit_p <- brms::brm(y ~ sqrt_roach1 + treatment + senior + offset(log(exposure2)),
955-
data = roaches,
956-
family = poisson,
957-
prior = brms::prior(normal(0, 1), class = b),
958-
refresh = 0)
959-
960-
fit_p <- brms::add_criterion(fit_p, criterion = "loo")
961-
fit_p <- brms::add_criterion(fit_p, criterion = "loo", moment_match = TRUE, overwrite = TRUE)
962-
fit_nb <- update(fit_p, family = brms::negbinomial)
963-
964-
expect_gg(brms::pp_check(fit_nb, type = "pit_ecdf"))
965-
966-
draws <- brms::posterior_predict(fit_nb)
967-
y <- roaches$y
968-
969-
expect_gg(ppc_pit_ecdf(
970-
y = y, yrep = draws, method = "correlated"
971-
))
972-
973-
expect_gg(brms::pp_check(fit_nb, type = "pit_ecdf", method = "correlated"))
974944
})

tests/testthat/test-ppc-loo.R

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -341,40 +341,6 @@ test_that("error if subset is bigger than num obs", {
341341
)
342342
})
343343

344-
test_that("ppc_loo_pit_ecdf works with pareto_pit method", {
345-
skip_on_cran()
346-
skip_if_not_installed("brms")
347-
skip_if_not_installed("rstanarm")
348-
349-
data("roaches", package = "rstanarm")
350-
roaches$sqrt_roach1 <- sqrt(roaches$roach1)
351-
352-
fit_zinb <-
353-
brms::brm(brms::bf(y ~ sqrt_roach1 + treatment + senior + offset(log(exposure2)),
354-
zi ~ sqrt_roach1 + treatment + senior + offset(log(exposure2))),
355-
family = brms::zero_inflated_negbinomial(), data = roaches,
356-
prior = c(brms::prior(normal(0, 1), class = "b"),
357-
brms::prior(normal(0, 1), class = "b", dpar = "zi"),
358-
brms::prior(normal(0, 1), class = "Intercept", dpar = "zi")),
359-
seed = 1704009, refresh = 1000)
360-
361-
fit_zinb <- brms::add_criterion(fit_zinb, criterion = "loo", save_psis = TRUE)
362-
fit_zinb <- brms::add_criterion(fit_zinb, criterion = "loo", save_psis = TRUE,
363-
moment_match = TRUE, overwrite = TRUE)
364-
365-
draws <- brms::posterior_predict(fit_zinb)
366-
psis_object <- brms::loo(fit_zinb, save_psis = TRUE)$psis_object
367-
y <- roaches$y
368-
369-
expect_gg(ppc_loo_pit_ecdf(
370-
y = y, yrep = draws, psis_object = psis_object, method = "correlated"
371-
))
372-
373-
expect_gg(brms::pp_check(
374-
fit_zinb, type = "loo_pit_ecdf", moment_match = TRUE, method = "correlated"
375-
))
376-
})
377-
378344

379345
# Visual tests ------------------------------------------------------------
380346

@@ -929,5 +895,4 @@ test_that("check pareto_pit argument is chosen as expected", {
929895
),
930896
regexp = "`pareto_pit = TRUE` cannot be used together with a non-`NULL`"
931897
)
932-
})
933-
898+
})

0 commit comments

Comments
 (0)