Skip to content

Commit 974c896

Browse files
committed
Replace Progress with CustomProgress
1 parent 5575767 commit 974c896

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pymc/sampling/parallel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,9 @@ def __iter__(self):
487487
self._active.remove(proc)
488488
self._finished.append(proc)
489489
self._make_active()
490-
progress.update(task, description=self._desc.format(self), refresh=True)
490+
491+
if self._progress.is_enabled:
492+
progress.update(task, description=self._desc.format(self), refresh=True)
491493

492494
# We could also yield proc.shared_point_view directly,
493495
# and only call proc.write_next() after the yield returns.

pymc/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ class CustomProgress(Progress):
531531
"""
532532

533533
def __init__(self, *args, **kwargs):
534-
self.is_enabled = kwargs.get("disable", None) is not True
534+
self.is_enabled = not kwargs.get("disable", None) is True
535535
if self.is_enabled:
536536
super().__init__(*args, **kwargs)
537537

0 commit comments

Comments
 (0)