@@ -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