@@ -11,18 +11,18 @@ test_that("check_divergences() works", {
11
11
csv_files <- c(test_path(" resources" , " csv" , " model1-2-no-warmup.csv" ))
12
12
csv_output <- read_cmdstan_csv(csv_files )
13
13
output <- " 14 of 100 \\ (14.0%\\ ) transitions ended with a divergence."
14
- expect_message(check_divergences(csv_contents $ post_warmup_sampler_diagnostics ), output )
14
+ expect_message(check_divergences(csv_output $ post_warmup_sampler_diagnostics ), output )
15
15
16
16
csv_files <- c(test_path(" resources" , " csv" , " model1-2-no-warmup.csv" ),
17
17
test_path(" resources" , " csv" , " model1-2-no-warmup.csv" ))
18
18
csv_output <- read_cmdstan_csv(csv_files )
19
19
output <- " 28 of 200 \\ (14.0%\\ ) transitions ended with a divergence."
20
- expect_message(check_divergences(csv_contents $ post_warmup_sampler_diagnostics ), output )
20
+ expect_message(check_divergences(csv_output $ post_warmup_sampler_diagnostics ), output )
21
21
22
22
csv_files <- c(test_path(" resources" , " csv" , " model1-2-warmup.csv" ))
23
23
csv_output <- read_cmdstan_csv(csv_files )
24
24
output <- " 1 of 100 \\ (1.0%\\ ) transitions ended with a divergence."
25
- expect_message(check_divergences(csv_contents $ post_warmup_sampler_diagnostics ), output )
25
+ expect_message(check_divergences(csv_output $ post_warmup_sampler_diagnostics ), output )
26
26
27
27
28
28
fit_wramup_no_samples <- testing_fit(" logistic" , method = " sample" ,
@@ -32,7 +32,7 @@ test_that("check_divergences() works", {
32
32
save_warmup = TRUE ,
33
33
validate_csv = FALSE )
34
34
csv_output <- read_cmdstan_csv(fit_wramup_no_samples $ output_files())
35
- expect_message(check_divergences(csv_contents $ post_warmup_sampler_diagnostics ), regexp = NA )
35
+ expect_message(check_divergences(csv_output $ post_warmup_sampler_diagnostics ), regexp = NA )
36
36
})
37
37
38
38
test_that(" check_sampler_transitions_treedepth() works" , {
@@ -42,8 +42,8 @@ test_that("check_sampler_transitions_treedepth() works", {
42
42
output <- " 16 of 100 \\ (16.0%\\ ) transitions hit the maximum treedepth limit of 5 or 2\\ ^5-1 leapfrog steps."
43
43
expect_message(
44
44
check_sampler_transitions_treedepth(
45
- csv_contents $ post_warmup_sampler_diagnostics ,
46
- csv_contents $ metadata ),
45
+ csv_output $ post_warmup_sampler_diagnostics ,
46
+ csv_output $ metadata ),
47
47
output
48
48
)
49
49
@@ -53,8 +53,8 @@ test_that("check_sampler_transitions_treedepth() works", {
53
53
output <- " 32 of 200 \\ (16.0%\\ ) transitions hit the maximum treedepth limit of 5 or 2\\ ^5-1 leapfrog steps."
54
54
expect_message(
55
55
check_sampler_transitions_treedepth(
56
- csv_contents $ post_warmup_sampler_diagnostics ,
57
- csv_contents $ metadata ),
56
+ csv_output $ post_warmup_sampler_diagnostics ,
57
+ csv_output $ metadata ),
58
58
output
59
59
)
60
60
@@ -63,8 +63,8 @@ test_that("check_sampler_transitions_treedepth() works", {
63
63
output <- " 1 of 100 \\ (1.0%\\ ) transitions hit the maximum treedepth limit of 5 or 2\\ ^5-1 leapfrog steps."
64
64
expect_message(
65
65
check_sampler_transitions_treedepth(
66
- csv_contents $ post_warmup_sampler_diagnostics ,
67
- csv_contents $ metadata ),
66
+ csv_output $ post_warmup_sampler_diagnostics ,
67
+ csv_output $ metadata ),
68
68
output
69
69
)
70
70
})
0 commit comments