diff --git a/NEWS.md b/NEWS.md index a7f78c4ee..a5e964ff5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,18 @@ +# cmdstanr 0.4.0.9000 + +### Bug fixes + +* In `cmdstan_default_path()` we now ignore directories inside `.cmdstan` that don't start +with `"cmdstan-"`. (#651) + +* Fixed Windows issue related to not locating `grep.exe` or when it is located in a path +with spaces. (@weshinsley, #661, #663) + +* Fixed a bug with diagnostic checks when ebfmi is NaN. + +* Fixed a bug that caused issues when using `~` or `.` in paths supplied to the +`cmdstanr_write_stan_file_dir` global option. + # cmdstanr 0.5.2 * Refactored toolchain installation and checks for R 4.x on Windows and added support diff --git a/R/example.R b/R/example.R index b314f05bb..388c555ef 100644 --- a/R/example.R +++ b/R/example.R @@ -148,6 +148,7 @@ write_stan_file <- function(code, basename = NULL, force_overwrite = FALSE, hash_salt = "") { + dir <- absolute_path(dir) if (!dir.exists(dir)) { dir.create(dir, recursive = TRUE) } diff --git a/tests/testthat/test-example.R b/tests/testthat/test-example.R index e0e7c8ff3..842a30752 100644 --- a/tests/testthat/test-example.R +++ b/tests/testthat/test-example.R @@ -48,13 +48,14 @@ test_that("write_stan_file writes Stan file correctly", { test_that("write_stan_file writes to specified directory and filename", { dir <- file.path(test_path(), "answers") - expect_equal(dirname(f1 <- write_stan_file(stan_program, dir = dir, basename = "pasta")), dir) + expect_equal(dirname(f1 <- write_stan_file(stan_program, dir = dir, basename = "pasta")), + absolute_path(dir)) expect_equal(f2 <- write_stan_file(stan_program, dir = dir, basename = "fruit.stan"), - file.path(dir, "fruit.stan")) + absolute_path(file.path(dir, "fruit.stan"))) expect_equal(f3 <- write_stan_file(stan_program, dir = dir, basename = "vegetable"), - file.path(dir, "vegetable.stan")) # should add .stan extension if missing + absolute_path(file.path(dir, "vegetable.stan"))) # should add .stan extension if missing expect_equal(f4 <- write_stan_file(stan_program, dir = tempdir(), basename = "test"), - file.path(tempdir(), "test.stan")) + absolute_path(file.path(tempdir(), "test.stan"))) try(file.remove(f1, f2, f3, f4), silent = TRUE) }) diff --git a/tests/testthat/test-model-compile.R b/tests/testthat/test-model-compile.R index 6fc8383cb..8779c2de9 100644 --- a/tests/testthat/test-model-compile.R +++ b/tests/testthat/test-model-compile.R @@ -590,7 +590,8 @@ test_that("cmdstan_model works with user_header", { namespace bernoulli_external_model_namespace { - template * = nullptr> + template >* = nullptr> inline typename boost::math::tools::promote_args::type make_odds(const T0__ & theta, std::ostream *pstream__)