Skip to content

Commit b74f4fb

Browse files
Add guard against divide by zero when computing draws per second
1 parent f849206 commit b74f4fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymc/sampling/parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def __iter__(self):
565565
self._divergences_by_chain[proc.chain] += 1
566566

567567
if self._show_progress:
568-
elapsed = progress._tasks[proc.chain].elapsed
568+
elapsed = max(progress._tasks[proc.chain].elapsed, 1e-4)
569569
speed = self._completed_draws_by_chain[proc.chain] / elapsed
570570

571571
if speed > 1:

0 commit comments

Comments
 (0)