From 3b4f6dbe91ecf0eed30834287d5058a39560a890 Mon Sep 17 00:00:00 2001 From: Tor Erlend Fjelde Date: Fri, 4 Oct 2024 11:50:22 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: David Widmann --- src/sample.jl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/sample.jl b/src/sample.jl index e59f0e32..7227029f 100644 --- a/src/sample.jl +++ b/src/sample.jl @@ -224,9 +224,6 @@ function mcmcsample( # Save the sample. samples = save!!(samples, sample, i, model, sampler, N; kwargs...) - # Increment iteration counter. - i += 1 - # Update the progress bar. if progress && (itotal += 1) >= next_update ProgressLogging.@logprogress itotal / Ntotal @@ -296,7 +293,7 @@ function mcmcsample( # Discard initial samples. for j in 1:discard_initial # Obtain the next sample and state. - sample, state = if j ≤ discard_from_warmup + sample, state = if j ≤ num_warmup step_warmup(rng, model, sampler, state; kwargs...) else step(rng, model, sampler, state; kwargs...)