@@ -169,7 +169,7 @@ function mcmcsample(
169
169
local state
170
170
171
171
@maybewithricherlogger begin
172
- init_progress (progress)
172
+ init_progress! (progress)
173
173
# Determine threshold values for progress logging (by default, one
174
174
# update per 0.5% of progress, unless this has been passed in
175
175
# explicitly)
@@ -195,7 +195,7 @@ function mcmcsample(
195
195
# Start the progress bar.
196
196
itotal = 1
197
197
if itotal >= next_update
198
- update_progress (progress, itotal / Ntotal)
198
+ update_progress! (progress, itotal / Ntotal)
199
199
next_update += threshold
200
200
end
201
201
@@ -211,7 +211,7 @@ function mcmcsample(
211
211
# Update the progress bar.
212
212
itotal += 1
213
213
if itotal >= next_update
214
- update_progress (progress, itotal / Ntotal)
214
+ update_progress! (progress, itotal / Ntotal)
215
215
next_update += threshold
216
216
end
217
217
end
@@ -237,7 +237,7 @@ function mcmcsample(
237
237
# Update progress bar.
238
238
itotal += 1
239
239
if itotal >= next_update
240
- update_progress (progress, itotal / Ntotal)
240
+ update_progress! (progress, itotal / Ntotal)
241
241
next_update += threshold
242
242
end
243
243
end
@@ -259,11 +259,11 @@ function mcmcsample(
259
259
# Update the progress bar.
260
260
itotal += 1
261
261
if itotal >= next_update
262
- update_progress (progress, itotal / Ntotal)
262
+ update_progress! (progress, itotal / Ntotal)
263
263
next_update += threshold
264
264
end
265
265
end
266
- finish_progress (progress)
266
+ finish_progress! (progress)
267
267
end
268
268
269
269
# Get the sample stop time.
@@ -322,7 +322,7 @@ function mcmcsample(
322
322
local state
323
323
324
324
@maybewithricherlogger begin
325
- init_progress (progress)
325
+ init_progress! (progress)
326
326
# Obtain the initial sample and state.
327
327
sample, state = if num_warmup > 0
328
328
if initial_state === nothing
@@ -385,7 +385,7 @@ function mcmcsample(
385
385
# Increment iteration counter.
386
386
i += 1
387
387
end
388
- finish_progress (progress)
388
+ finish_progress! (progress)
389
389
end
390
390
391
391
# Get the sample stop time.
@@ -474,7 +474,7 @@ function mcmcsample(
474
474
# by a channel, but it is not itself a ChannelProgress (because
475
475
# ChannelProgress doesn't come with a progress bar).
476
476
overall_progress_bar = CreateNewProgressBar (progressname)
477
- init_progress (overall_progress_bar)
477
+ init_progress! (overall_progress_bar)
478
478
# These are the per-chain progress bars. We generate `nchains`
479
479
# independent UUIDs for each progress bar
480
480
child_progresses = [
@@ -484,7 +484,7 @@ function mcmcsample(
484
484
# ProgressLogging prints from the bottom up, and we want chain 1 to
485
485
# show up at the top)
486
486
for child_progress in reverse (child_progresses)
487
- init_progress (child_progress)
487
+ init_progress! (child_progress)
488
488
end
489
489
updates_per_chain = nothing
490
490
elseif progress == :overall
@@ -518,11 +518,11 @@ function mcmcsample(
518
518
while take! (progress_channel)
519
519
itotal += 1
520
520
if itotal >= next_update
521
- update_progress (overall_progress_bar, itotal / Ntotal)
521
+ update_progress! (overall_progress_bar, itotal / Ntotal)
522
522
next_update += threshold
523
523
end
524
524
end
525
- finish_progress (overall_progress_bar)
525
+ finish_progress! (overall_progress_bar)
526
526
end
527
527
end
528
528
@@ -578,7 +578,7 @@ function mcmcsample(
578
578
# Tell the 'main' progress bar that this chain is done.
579
579
put! (progress_channel, true )
580
580
# Conclude the per-chain progress bar.
581
- finish_progress (child_progresses[chainidx])
581
+ finish_progress! (child_progresses[chainidx])
582
582
end
583
583
# Note that if progress == :overall, we don't need to do anything
584
584
# because progress on that bar is triggered by
@@ -593,7 +593,7 @@ function mcmcsample(
593
593
put! (progress_channel, false )
594
594
# Additionally stop the per-chain progress bars
595
595
for child_progress in child_progresses
596
- finish_progress (child_progress)
596
+ finish_progress! (child_progress)
597
597
end
598
598
elseif progress == :overall
599
599
# Stop updating the main progress bar (either if sampling
@@ -670,7 +670,7 @@ function mcmcsample(
670
670
chan = Channel {Bool} (Distributed. nworkers ())
671
671
progress_channel = Distributed. RemoteChannel (() -> chan)
672
672
overall_progress_bar = CreateNewProgressBar (progressname)
673
- init_progress (overall_progress_bar)
673
+ init_progress! (overall_progress_bar)
674
674
# See MCMCThreads method for the rationale behind updates_per_chain.
675
675
updates_per_chain = max (1 , 400 ÷ nchains)
676
676
child_progresses = [
@@ -694,11 +694,11 @@ function mcmcsample(
694
694
while take! (progress_channel)
695
695
itotal += 1
696
696
if itotal >= next_update
697
- update_progress (overall_progress_bar, itotal / Ntotal)
697
+ update_progress! (overall_progress_bar, itotal / Ntotal)
698
698
next_update += threshold
699
699
end
700
700
end
701
- finish_progress (overall_progress_bar)
701
+ finish_progress! (overall_progress_bar)
702
702
end
703
703
end
704
704
0 commit comments