Skip to content

Commit c1c506c

Browse files
committed
Merge branch 'master' into fix-toolchain-checks-windows
2 parents 22ac577 + 5fc41ea commit c1c506c

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

NEWS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# cmdstanr 0.4.0.9000
2+
3+
### Bug fixes
4+
5+
* In `cmdstan_default_path()` we now ignore directories inside `.cmdstan` that don't start
6+
with `"cmdstan-"`. (#651)
7+
8+
* Fixed Windows issue related to not locating `grep.exe` or when it is located in a path
9+
with spaces. (@weshinsley, #661, #663)
10+
11+
* Fixed a bug with diagnostic checks when ebfmi is NaN.
12+
13+
* Fixed a bug that caused issues when using `~` or `.` in paths supplied to the
14+
`cmdstanr_write_stan_file_dir` global option.
15+
116
# cmdstanr 0.5.2
217

318
* Refactored toolchain installation and checks for R 4.x on Windows and added support

R/example.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ write_stan_file <- function(code,
148148
basename = NULL,
149149
force_overwrite = FALSE,
150150
hash_salt = "") {
151+
dir <- absolute_path(dir)
151152
if (!dir.exists(dir)) {
152153
dir.create(dir, recursive = TRUE)
153154
}

tests/testthat/test-example.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ test_that("write_stan_file writes Stan file correctly", {
4848

4949
test_that("write_stan_file writes to specified directory and filename", {
5050
dir <- file.path(test_path(), "answers")
51-
expect_equal(dirname(f1 <- write_stan_file(stan_program, dir = dir, basename = "pasta")), dir)
51+
expect_equal(dirname(f1 <- write_stan_file(stan_program, dir = dir, basename = "pasta")),
52+
absolute_path(dir))
5253
expect_equal(f2 <- write_stan_file(stan_program, dir = dir, basename = "fruit.stan"),
53-
file.path(dir, "fruit.stan"))
54+
absolute_path(file.path(dir, "fruit.stan")))
5455
expect_equal(f3 <- write_stan_file(stan_program, dir = dir, basename = "vegetable"),
55-
file.path(dir, "vegetable.stan")) # should add .stan extension if missing
56+
absolute_path(file.path(dir, "vegetable.stan"))) # should add .stan extension if missing
5657
expect_equal(f4 <- write_stan_file(stan_program, dir = tempdir(), basename = "test"),
57-
file.path(tempdir(), "test.stan"))
58+
absolute_path(file.path(tempdir(), "test.stan")))
5859

5960
try(file.remove(f1, f2, f3, f4), silent = TRUE)
6061
})

tests/testthat/test-model-compile.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,8 @@ test_that("cmdstan_model works with user_header", {
590590
591591
namespace bernoulli_external_model_namespace
592592
{
593-
template <typename T0__, stan::require_stan_scalar_t<T0__>* = nullptr>
593+
template <typename T0__,
594+
stan::require_all_t<stan::is_stan_scalar<T0__>>* = nullptr>
594595
inline typename boost::math::tools::promote_args<T0__>::type make_odds(const T0__ &
595596
theta,
596597
std::ostream *pstream__)

0 commit comments

Comments
 (0)