@@ -144,7 +144,7 @@ function mcmcsample(
144
144
@ifwithprogresslogger progress name = progressname begin
145
145
# Determine threshold values for progress logging
146
146
# (one update per 0.5% of progress)
147
- if progress
147
+ if ( progress == true || progress === nothing )
148
148
threshold = Ntotal ÷ 200
149
149
next_update = threshold
150
150
end
@@ -166,8 +166,12 @@ function mcmcsample(
166
166
167
167
# Update the progress bar.
168
168
itotal = 1
169
- if progress && itotal >= next_update
170
- ProgressLogging. @logprogress itotal / Ntotal
169
+ if ! (progress == false ) && itotal >= next_update
170
+ if progress == true
171
+ ProgressLogging. @logprogress itotal / Ntotal
172
+ else
173
+ ProgressLogging. @logprogress itotal / Ntotal _id = " hello"
174
+ end
171
175
next_update = itotal + threshold
172
176
end
173
177
@@ -181,8 +185,12 @@ function mcmcsample(
181
185
end
182
186
183
187
# Update the progress bar.
184
- if progress && (itotal += 1 ) >= next_update
185
- ProgressLogging. @logprogress itotal / Ntotal
188
+ if ! (progress == false ) && (itotal += 1 ) >= next_update
189
+ if progress == true
190
+ ProgressLogging. @logprogress itotal / Ntotal
191
+ else
192
+ ProgressLogging. @logprogress itotal / Ntotal _id = " hello"
193
+ end
186
194
next_update = itotal + threshold
187
195
end
188
196
end
@@ -206,8 +214,12 @@ function mcmcsample(
206
214
end
207
215
208
216
# Update progress bar.
209
- if progress && (itotal += 1 ) >= next_update
210
- ProgressLogging. @logprogress itotal / Ntotal
217
+ if ! (progress == false ) && (itotal += 1 ) >= next_update
218
+ if progress == true
219
+ ProgressLogging. @logprogress itotal / Ntotal
220
+ else
221
+ ProgressLogging. @logprogress itotal / Ntotal _id = " hello"
222
+ end
211
223
next_update = itotal + threshold
212
224
end
213
225
end
@@ -227,8 +239,12 @@ function mcmcsample(
227
239
samples = save!! (samples, sample, i, model, sampler, N; kwargs... )
228
240
229
241
# Update the progress bar.
230
- if progress && (itotal += 1 ) >= next_update
231
- ProgressLogging. @logprogress itotal / Ntotal
242
+ if ! (progress == false ) && (itotal += 1 ) >= next_update
243
+ if progress == true
244
+ ProgressLogging. @logprogress itotal / Ntotal
245
+ else
246
+ ProgressLogging. @logprogress itotal / Ntotal _id = " hello"
247
+ end
232
248
next_update = itotal + threshold
233
249
end
234
250
end
@@ -456,12 +472,17 @@ function mcmcsample(
456
472
Random. seed! (_rng, seeds[chainidx])
457
473
458
474
# Sample a chain and save it to the vector.
459
- chains[chainidx] = StatsBase. sample (
475
+ child_progress = if progress == false
476
+ false
477
+ else
478
+ nothing
479
+ end
480
+ @ifwithprogresslogger progress chains[chainidx] = StatsBase. sample (
460
481
_rng,
461
482
_model,
462
483
_sampler,
463
484
N;
464
- progress= false ,
485
+ progress= child_progress ,
465
486
initial_params= if initial_params === nothing
466
487
nothing
467
488
else
0 commit comments