Skip to content

Commit

Permalink
Add update method to CustomProgress
Browse files Browse the repository at this point in the history
  • Loading branch information
tomicapretto committed May 1, 2024
1 parent d2bb020 commit 4fd6f32
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions pymc/sampling/parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,7 @@ def __iter__(self):
self._active.remove(proc)
self._finished.append(proc)
self._make_active()

if self._progress.is_enabled:
progress.update(task, description=self._desc.format(self), refresh=True)
progress.update(task, description=self._desc.format(self), refresh=True)

# We could also yield proc.shared_point_view directly,
# and only call proc.write_next() after the yield returns.
Expand Down
2 changes: 1 addition & 1 deletion pymc/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class CustomProgress(Progress):
"""

def __init__(self, *args, **kwargs):
self.is_enabled = not kwargs.get("disable", None) is True
self.is_enabled = kwargs.get("disable", None) is not True
if self.is_enabled:
super().__init__(*args, **kwargs)

Expand Down

0 comments on commit 4fd6f32

Please sign in to comment.