Skip to content

Commit

Permalink
dots to insepct
Browse files Browse the repository at this point in the history
  • Loading branch information
macartan committed Oct 21, 2024
1 parent 6c25661 commit f2d1ba3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/inspect.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ grab <- function(model, what = NULL, ...)
}

if (what %in% .large) {
model_sum <- summary(model, include = what)
model_sum <- summary(model, include = what, ...)
} else {
model_sum <- summary(model)
model_sum <- summary(model, ...)
}

if (print) print(model_sum, what = what)
Expand Down
10 changes: 10 additions & 0 deletions tests/testthat/test_inspect.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,13 @@ test_that("inspect outputs correct stanfit", {
expect_output(inspect(model, what = "stanfit"), "Inference for Stan model: simplexes.")
})



test_that("inspect handles dots", {
expect_true(make_model("X->Y") |>
inspect("prior_hyperparameters", nodes = "Y") |>
length() == 4)
})



0 comments on commit f2d1ba3

Please sign in to comment.