Skip to content

Commit ede30d3

Browse files
committed
fix test
1 parent 4f03f59 commit ede30d3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/testthat/test-extractors.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ test_that("cmdstanr methods work", {
121121

122122
fit <- cmdstanr::cmdstanr_example("logistic", iter_sampling = 500, chains = 2)
123123
np <- nuts_params(fit)
124-
np_names <- paste0(c("accept_stat", "stepsize", "treedepth", "n_leapfrog",
125-
"divergent", "energy"), "__")
124+
np_names <- c("treedepth__", "divergent__", "accept_stat__", "stepsize__",
125+
"n_leapfrog__", "energy__")
126126
expect_identical(levels(np$Parameter), np_names)
127127
expect_equal(range(np$Iteration), c(1, 500))
128128
expect_equal(range(np$Chain), c(1, 2))
@@ -134,10 +134,10 @@ test_that("cmdstanr methods work", {
134134
expect_equal(range(np$Iteration), c(1, 500))
135135

136136
r <- rhat(fit)
137-
expect_named(r, c("alpha", "beta[1]", "beta[2]", "beta[3]"))
137+
expect_named(head(r, 4), c("alpha", "beta[1]", "beta[2]", "beta[3]"))
138138
expect_true(all(round(r) == 1))
139139

140140
ratio <- neff_ratio(fit)
141-
expect_named(ratio, c("alpha", "beta[1]", "beta[2]", "beta[3]"))
141+
expect_named(head(ratio, 4), c("alpha", "beta[1]", "beta[2]", "beta[3]"))
142142
expect_true(all(ratio > 0))
143143
})

0 commit comments

Comments
 (0)