Skip to content

Commit e1d1c60

Browse files
committed
fix for fixed_param
1 parent eee2fb6 commit e1d1c60

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

R/read_csv.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,13 @@ read_csv_metadata <- function(csv_file) {
412412
if (!startsWith(line, "#") && is.null(csv_file_info[["model_params"]])) {
413413
# if no # at the start of line, the line is the CSV header
414414
all_names <- strsplit(line, ",")[[1]]
415-
csv_file_info[["sampler_diagnostics"]] <- all_names[endsWith(all_names, "__")]
416-
csv_file_info[["sampler_diagnostics"]] <- csv_file_info[["sampler_diagnostics"]][!(csv_file_info[["sampler_diagnostics"]] %in% c("lp__", "log_p__", "log_g__"))]
417-
csv_file_info[["model_params"]] <- all_names[!(all_names %in% csv_file_info[["sampler_diagnostics"]])]
415+
if (all(csv_file_info$algorithm != "fixed_param")) {
416+
csv_file_info[["sampler_diagnostics"]] <- all_names[endsWith(all_names, "__")]
417+
csv_file_info[["sampler_diagnostics"]] <- csv_file_info[["sampler_diagnostics"]][!(csv_file_info[["sampler_diagnostics"]] %in% c("lp__", "log_p__", "log_g__"))]
418+
csv_file_info[["model_params"]] <- all_names[!(all_names %in% csv_file_info[["sampler_diagnostics"]])]
419+
} else {
420+
csv_file_info[["model_params"]] <- all_names[!endsWith(all_names, "__")]
421+
}
418422
} else {
419423
parse_key_val <- TRUE
420424
if (regexpr("# Diagonal elements of inverse mass matrix:", line, perl = TRUE) > 0

0 commit comments

Comments
 (0)