Skip to content

Commit

Permalink
Catch the dot-dot-dot and modify iter if present
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed Nov 10, 2023
1 parent ee247d9 commit 30c6deb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/opts.R
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,7 @@ rstan_sampling_opts <- function(cores = getOption("mc.cores", 1L),
future = FALSE,
max_execution_time = Inf,
...) {
dot_args <- list(...)
opts <- list(
cores = cores,
warmup = warmup,
Expand All @@ -560,8 +561,9 @@ rstan_sampling_opts <- function(cores = getOption("mc.cores", 1L),
)
control_def <- list(adapt_delta = 0.95, max_treedepth = 15)
opts$control <- modifyList(control_def, control)
dot_args$iter <- NULL
opts$iter <- ceiling(samples / opts$chains) + opts$warmup
opts <- c(opts, ...)
opts <- c(opts, dot_args)
return(opts)
}

Expand Down

0 comments on commit 30c6deb

Please sign in to comment.