Skip to content

Commit 0e2758c

Browse files
authored
Merge pull request #640 from stan-dev/temporarily-disable-rvars
temporarily disable rvars
2 parents 7f535e1 + 324957c commit 0e2758c

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: cmdstanr
22
Title: R Interface to 'CmdStan'
3-
Version: 0.5.0
4-
Date: 2022-03-17
3+
Version: 0.5.1
4+
Date: 2022-04-06
55
Authors@R:
66
c(person(given = "Jonah", family = "Gabry", role = c("aut", "cre"),
77
email = "[email protected]"),

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# cmdstanr 0.5.1
2+
3+
* Temporarily disable `format="draws_rvars"` in the `$draws()` method due to a
4+
bug. Until this is fixed users can make use of `posterior::as_draws_rvars()` to
5+
convert draws from CmdStanR to the `draws_rvars` format. (#640)
6+
17
# cmdstanr 0.5.0
28

39
### Bug fixes

R/fit.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ CmdStanFit$set("public", name = "code", value = code)
823823
#'
824824
#' |**Method**|**Description**|
825825
#' |:----------|:---------------|
826+
#' [`$print()`][fit-method-print] | Run [`posterior::summarise_draws()`][posterior::draws_summary]. |
826827
#' [`$summary()`][fit-method-summary] | Run [`posterior::summarise_draws()`][posterior::draws_summary]. |
827828
#' [`$diagnostic_summary()`][fit-method-diagnostic_summary] | Get summaries of sampler diagnostics and warning messages. |
828829
#' [`$cmdstan_summary()`][fit-method-cmdstan_summary] | Run and print CmdStan's `bin/stansummary`. |

R/utils.R

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,19 @@ as_draws_format_fun <- function(draws_format) {
356356
}
357357

358358
assert_valid_draws_format <- function(format) {
359-
if (!is.null(format) &&
360-
!format %in% valid_draws_formats()) {
361-
stop(
362-
"The supplied draws format is not valid. ",
363-
call. = FALSE
364-
)
359+
if (!is.null(format)) {
360+
if (!format %in% valid_draws_formats()) {
361+
stop(
362+
"The supplied draws format is not valid. ",
363+
call. = FALSE
364+
)
365+
}
366+
if (format %in% c("rvars", "draws_rvars")) {
367+
stop(
368+
"\nWe are fixing a bug in fit$draws(format = 'draws_rvars').",
369+
"\nFor now please use posterior::as_draws_rvars(fit$draws()) instead."
370+
)
371+
}
365372
}
366373
invisible(format)
367374
}

man/CmdStanMCMC.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/profiling.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ data {
4646
int<lower=1> k;
4747
int<lower=0> n;
4848
matrix[n, k] X;
49-
int y[n];
49+
array[n] int y;
5050
}
5151
parameters {
5252
vector[k] beta;
@@ -84,7 +84,7 @@ data {
8484
int<lower=1> k;
8585
int<lower=0> n;
8686
matrix[n, k] X;
87-
int y[n];
87+
array[n] int y;
8888
}
8989
parameters {
9090
vector[k] beta;
@@ -157,7 +157,7 @@ data {
157157
int<lower=1> k;
158158
int<lower=0> n;
159159
matrix[n, k] X;
160-
int y[n];
160+
array[n] int y;
161161
}
162162
parameters {
163163
vector[k] beta;

0 commit comments

Comments
 (0)