Skip to content

Commit bf4f5ae

Browse files
committed
Fix Issue stan-dev#765
1 parent 317f1f4 commit bf4f5ae

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

R/model.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,7 @@ model_compile_info <- function(exe_file) {
23992399
if (!is.na(as.logical(val))) {
24002400
val <- as.logical(val)
24012401
}
2402-
info[[toupper(key_val[1])]] <- val
2402+
info[[tolower(key_val[1])]] <- val
24032403
}
24042404
}
24052405
info[["STAN_VERSION"]] <- paste0(info[["STAN_VERSION_MAJOR"]], ".", info[["STAN_VERSION_MINOR"]], ".", info[["STAN_VERSION_PATCH"]])

tests/testthat/test-example.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
context("cmdstanr_example")
22

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

tests/testthat/test-model-compile.R

+4-2
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,15 @@ test_that("cpp_options work with settings in make/local", {
496496

497497
rebuild_cmdstan()
498498
mod <- cmdstan_model(stan_file = stan_program)
499-
expect_null(mod$cpp_options()$STAN_THREADS)
499+
expect_null(mod$cpp_options()$stan_threads)
500500

501501
file.remove(mod$exe_file())
502502

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

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

509509
file.remove(mod$exe_file())
510510

@@ -789,6 +789,8 @@ test_that("overwrite_file works with format()", {
789789
}
790790
"
791791
stan_file_tmp <- write_stan_file(code)
792+
on.exit(file.remove(stan_file_tmp))
793+
792794
mod_1 <- cmdstan_model(stan_file_tmp, compile = FALSE)
793795
expect_false(
794796
any(

0 commit comments

Comments
 (0)