Skip to content

Commit

Permalink
Format true/false to 1/0 in csv read
Browse files Browse the repository at this point in the history
  • Loading branch information
andrjohns committed May 16, 2024
1 parent 1f4efad commit 59246a8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check-wsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Install cmdstan
run: |
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan(cores = 2, wsl = TRUE, overwrite = TRUE)
cmdstanr::install_cmdstan(cores = 2, wsl = TRUE, overwrite = TRUE, version = "2.35.0-rc2")
shell: Rscript {0}

- name: Session info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Install cmdstan
run: |
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan(cores = 2)
cmdstanr::install_cmdstan(cores = 2, version = "2.35.0-rc2")
shell: Rscript {0}

- name: Session info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install cmdstan
run: |
cmdstanr::check_cmdstan_toolchain(fix = TRUE)
cmdstanr::install_cmdstan(cores = 2)
cmdstanr::install_cmdstan(cores = 2, version = "2.35.0-rc2")
shell: Rscript {0}

- name: Test coverage (Linux)
Expand Down
8 changes: 8 additions & 0 deletions R/csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,14 @@ read_csv_metadata <- function(csv_file) {
csv_file_info$fitted_params <- wsl_safe_path(csv_file_info$fitted_params,
revert = TRUE)
}
csv_file_info <- lapply(csv_file_info, function(item) {
if (is.character(item) && length(item) == 1) {
if (item %in% c("true", "false")) {
item <- as.integer(as.logical(item))
}
}
item
})
csv_file_info
}

Expand Down

0 comments on commit 59246a8

Please sign in to comment.