Skip to content

Commit

Permalink
Merge pull request #640 from stan-dev/temporarily-disable-rvars
Browse files Browse the repository at this point in the history
temporarily disable rvars
  • Loading branch information
jgabry authored Apr 7, 2022
2 parents 7f535e1 + 324957c commit 0e2758c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: cmdstanr
Title: R Interface to 'CmdStan'
Version: 0.5.0
Date: 2022-03-17
Version: 0.5.1
Date: 2022-04-06
Authors@R:
c(person(given = "Jonah", family = "Gabry", role = c("aut", "cre"),
email = "[email protected]"),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# cmdstanr 0.5.1

* Temporarily disable `format="draws_rvars"` in the `$draws()` method due to a
bug. Until this is fixed users can make use of `posterior::as_draws_rvars()` to
convert draws from CmdStanR to the `draws_rvars` format. (#640)

# cmdstanr 0.5.0

### Bug fixes
Expand Down
1 change: 1 addition & 0 deletions R/fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ CmdStanFit$set("public", name = "code", value = code)
#'
#' |**Method**|**Description**|
#' |:----------|:---------------|
#' [`$print()`][fit-method-print] | Run [`posterior::summarise_draws()`][posterior::draws_summary]. |
#' [`$summary()`][fit-method-summary] | Run [`posterior::summarise_draws()`][posterior::draws_summary]. |
#' [`$diagnostic_summary()`][fit-method-diagnostic_summary] | Get summaries of sampler diagnostics and warning messages. |
#' [`$cmdstan_summary()`][fit-method-cmdstan_summary] | Run and print CmdStan's `bin/stansummary`. |
Expand Down
19 changes: 13 additions & 6 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,19 @@ as_draws_format_fun <- function(draws_format) {
}

assert_valid_draws_format <- function(format) {
if (!is.null(format) &&
!format %in% valid_draws_formats()) {
stop(
"The supplied draws format is not valid. ",
call. = FALSE
)
if (!is.null(format)) {
if (!format %in% valid_draws_formats()) {
stop(
"The supplied draws format is not valid. ",
call. = FALSE
)
}
if (format %in% c("rvars", "draws_rvars")) {
stop(
"\nWe are fixing a bug in fit$draws(format = 'draws_rvars').",
"\nFor now please use posterior::as_draws_rvars(fit$draws()) instead."
)
}
}
invisible(format)
}
Expand Down
1 change: 1 addition & 0 deletions man/CmdStanMCMC.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vignettes/profiling.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ data {
int<lower=1> k;
int<lower=0> n;
matrix[n, k] X;
int y[n];
array[n] int y;
}
parameters {
vector[k] beta;
Expand Down Expand Up @@ -84,7 +84,7 @@ data {
int<lower=1> k;
int<lower=0> n;
matrix[n, k] X;
int y[n];
array[n] int y;
}
parameters {
vector[k] beta;
Expand Down Expand Up @@ -157,7 +157,7 @@ data {
int<lower=1> k;
int<lower=0> n;
matrix[n, k] X;
int y[n];
array[n] int y;
}
parameters {
vector[k] beta;
Expand Down

0 comments on commit 0e2758c

Please sign in to comment.