Skip to content

Commit

Permalink
Fix Issue stan-dev#765
Browse files Browse the repository at this point in the history
  • Loading branch information
katrinabrock committed Dec 18, 2024
1 parent d17a5a7 commit acb109a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/model.R
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,7 @@ model_compile_info <- function(exe_file) {
if (!is.na(as.logical(val))) {
val <- as.logical(val)
}
info[[toupper(key_val[1])]] <- val
info[[tolower(key_val[1])]] <- val
}
}
info[["STAN_VERSION"]] <- paste0(info[["STAN_VERSION_MAJOR"]], ".", info[["STAN_VERSION_MINOR"]], ".", info[["STAN_VERSION_PATCH"]])
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-example.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
context("cmdstanr_example")

test_that("cmdstanr_example works", {
fit_mcmc <- cmdstanr_example("logistic", chains = 2)
fit_mcmc <- cmdstanr_example("logistic", chains = 2, force_recompile = TRUE)
checkmate::expect_r6(fit_mcmc, "CmdStanMCMC")
expect_equal(fit_mcmc$num_chains(), 2)

Expand Down
6 changes: 4 additions & 2 deletions tests/testthat/test-model-compile.R
Original file line number Diff line number Diff line change
Expand Up @@ -496,15 +496,15 @@ test_that("cpp_options work with settings in make/local", {

rebuild_cmdstan()
mod <- cmdstan_model(stan_file = stan_program)
expect_null(mod$cpp_options()$STAN_THREADS)
expect_null(mod$cpp_options()$stan_threads)

file.remove(mod$exe_file())

cmdstan_make_local(cpp_options = list(stan_threads = TRUE), append = TRUE)

file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
mod <- cmdstan_model(file)
expect_true(mod$cpp_options()$STAN_THREADS)
expect_true(mod$cpp_options()$stan_threads)

file.remove(mod$exe_file())

Expand Down Expand Up @@ -789,6 +789,8 @@ test_that("overwrite_file works with format()", {
}
"
stan_file_tmp <- write_stan_file(code)
on.exit(file.remove(stan_file_tmp))

mod_1 <- cmdstan_model(stan_file_tmp, compile = FALSE)
expect_false(
any(
Expand Down

0 comments on commit acb109a

Please sign in to comment.