diff --git a/DESCRIPTION b/DESCRIPTION index c083b7126..cf63bef8f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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 = "jsg2201@columbia.edu"), diff --git a/NEWS.md b/NEWS.md index 685bc5802..4a09a8445 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/R/fit.R b/R/fit.R index d30eb4ec3..6a3b1474f 100644 --- a/R/fit.R +++ b/R/fit.R @@ -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`. | diff --git a/R/utils.R b/R/utils.R index ee9216675..3a49b267a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -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) } diff --git a/man/CmdStanMCMC.Rd b/man/CmdStanMCMC.Rd index 950beffca..98b7f4374 100644 --- a/man/CmdStanMCMC.Rd +++ b/man/CmdStanMCMC.Rd @@ -28,6 +28,7 @@ methods, all of which have their own (linked) documentation pages. \subsection{Summarize inferences and diagnostics}{\tabular{ll}{ \strong{Method} \tab \strong{Description} \cr + \code{\link[=fit-method-print]{$print()}} \tab Run \code{\link[posterior:draws_summary]{posterior::summarise_draws()}}. \cr \code{\link[=fit-method-summary]{$summary()}} \tab Run \code{\link[posterior:draws_summary]{posterior::summarise_draws()}}. \cr \code{\link[=fit-method-diagnostic_summary]{$diagnostic_summary()}} \tab Get summaries of sampler diagnostics and warning messages. \cr \code{\link[=fit-method-cmdstan_summary]{$cmdstan_summary()}} \tab Run and print CmdStan's \code{bin/stansummary}. \cr diff --git a/vignettes/profiling.Rmd b/vignettes/profiling.Rmd index 0e2ec0d9f..b7449acb4 100644 --- a/vignettes/profiling.Rmd +++ b/vignettes/profiling.Rmd @@ -46,7 +46,7 @@ data { int k; int n; matrix[n, k] X; - int y[n]; + array[n] int y; } parameters { vector[k] beta; @@ -84,7 +84,7 @@ data { int k; int n; matrix[n, k] X; - int y[n]; + array[n] int y; } parameters { vector[k] beta; @@ -157,7 +157,7 @@ data { int k; int n; matrix[n, k] X; - int y[n]; + array[n] int y; } parameters { vector[k] beta;