Skip to content

Commit e67acdc

Browse files
committed
consolidate progress bar function
1 parent c8d83ca commit e67acdc

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

pymc/util.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -859,15 +859,7 @@ def _initialize_tasks(self):
859859

860860
def compute_draw_speed(self, chain_idx, draws):
861861
elapsed = self._progress.tasks[chain_idx].elapsed
862-
speed = draws / max(elapsed, 1e-6)
863-
864-
if speed > 1 or speed == 0:
865-
unit = "draws/s"
866-
else:
867-
unit = "s/draws"
868-
speed = 1 / speed
869-
870-
return speed, unit
862+
return compute_draw_speed(elapsed, draws)
871863

872864
def update(self, chain_idx, is_last, draw, tuning, stats):
873865
if not self._show_progress:

0 commit comments

Comments
 (0)