Skip to content

Commit 86557d8

Browse files
committed
Move logic in () query method
1 parent c87879a commit 86557d8

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

R/model.R

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,11 @@ CmdStanModel <- R6::R6Class(
265265
invisible(self)
266266
},
267267
include_paths = function() {
268-
private$include_paths_
268+
if (length(self$exe_file()) > 0 && file.exists(self$exe_file())) {
269+
return(private$include_paths_)
270+
} else {
271+
return(private$precompile_include_paths_)
272+
}
269273
},
270274
code = function() {
271275
if (length(private$stan_code_) == 0) {
@@ -655,13 +659,7 @@ variables <- function() {
655659
if (is.null(private$variables_) && file.exists(self$stan_file())) {
656660
private$variables_ <- model_variables(
657661
stan_file = self$stan_file(),
658-
include_paths = {
659-
if (length(self$exe_file()) > 0 && file.exists(self$exe_file())) {
660-
self$include_paths()
661-
} else {
662-
private$precompile_include_paths_
663-
}
664-
},
662+
include_paths = self$include_paths(),
665663
allow_undefined = private$using_user_header_
666664
)
667665
}

0 commit comments

Comments
 (0)