Skip to content

Commit 620458f

Browse files
committed
Update file path for WSL
1 parent 5c2dbbd commit 620458f

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

R/args.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,10 @@ LaplaceArgs <- R6::R6Class(
440440
jacobian = TRUE) {
441441
checkmate::assert_r6(mode, classes = "CmdStanMLE")
442442
self$mode_object <- mode # keep the CmdStanMLE for later use (can be returned by CmdStanLaplace$mode())
443-
self$mode <- self$mode_object$output_files() # mode <- file path to pass to CmdStan
443+
# mode <- file path to pass to CmdStan
444+
# This needs to be a path that can be accessed within WSL
445+
# since the files are used by CmdStan, not R
446+
self$mode <- wsl_safe_path(self$mode_object$output_files())
444447
self$jacobian <- jacobian
445448
self$draws <- draws
446449
invisible(self)
@@ -761,7 +764,7 @@ validate_optimize_args <- function(self) {
761764
#' @param self A `LaplaceArgs` object.
762765
#' @return `TRUE` invisibly unless an error is thrown.
763766
validate_laplace_args <- function(self) {
764-
checkmate::assert_file_exists(self$mode, extension = "csv")
767+
assert_file_exists(self$mode, extension = "csv")
765768
checkmate::assert_integerish(self$draws, lower = 1, null.ok = TRUE, len = 1)
766769
if (!is.null(self$draws)) {
767770
self$draws <- as.integer(self$draws)

0 commit comments

Comments
 (0)