Skip to content

Commit 9b8d8fe

Browse files
authored
Merge pull request #1131 from bdeonovic/patch-1
Fix stan CSV parsing for save warmups
2 parents 50c3c6f + a40fd72 commit 9b8d8fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rstan/rstan/R/stan_csv.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ parse_stancsv_comments <- function(comments) {
107107
}
108108
names1 <- intersect(c("thin", "iter", "warmup", "chain_id", "max_depth",
109109
"num_samples", "num_warmup", "id",
110-
"max_treedepth", "save_warmup"), names0)
110+
"max_treedepth"), names0)
111111
names2 <- intersect(c("stepsize", "stepsize_jitter", "adapt_gamma", "adapt_kappa",
112112
"adapt_delta", "gamma", "kappa", "delta", "t0",
113113
"adapt_t0"), names0)
114+
if ("save_warmup" %in% names(values)) values[["save_warmup"]] <- as.integer(as.logical(values[["save_warmup"]]))
114115
for (z in names1) values[[z]] <- as.integer(values[[z]])
115116
for (z in names2) values[[z]] <- as.numeric(values[[z]])
116117
if (compute_iter) values[["iter"]] <- values[["iter"]] + values[["warmup"]]

0 commit comments

Comments
 (0)