Skip to content

Commit

Permalink
Merge pull request #1131 from bdeonovic/patch-1
Browse files Browse the repository at this point in the history
Fix stan CSV parsing for save warmups
  • Loading branch information
jgabry committed Jul 18, 2024
2 parents 50c3c6f + a40fd72 commit 9b8d8fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rstan/rstan/R/stan_csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ parse_stancsv_comments <- function(comments) {
}
names1 <- intersect(c("thin", "iter", "warmup", "chain_id", "max_depth",
"num_samples", "num_warmup", "id",
"max_treedepth", "save_warmup"), names0)
"max_treedepth"), names0)
names2 <- intersect(c("stepsize", "stepsize_jitter", "adapt_gamma", "adapt_kappa",
"adapt_delta", "gamma", "kappa", "delta", "t0",
"adapt_t0"), names0)
if ("save_warmup" %in% names(values)) values[["save_warmup"]] <- as.integer(as.logical(values[["save_warmup"]]))
for (z in names1) values[[z]] <- as.integer(values[[z]])
for (z in names2) values[[z]] <- as.numeric(values[[z]])
if (compute_iter) values[["iter"]] <- values[["iter"]] + values[["warmup"]]
Expand Down

0 comments on commit 9b8d8fe

Please sign in to comment.