Skip to content

Commit

Permalink
Set dynamic_ncols=True to improve layout of tqdm progress bars
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-denham committed May 20, 2024
1 parent bc8b3ae commit 82b7eec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions labtech/lab.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ def get_pbar(self, *, task_type: Type[Task], task_count: int) -> tqdm:
total=task_count,
bar_format='{desc}: {n_fmt}/{total_fmt} [{elapsed}, {rate_fmt}{postfix}] |{bar}| {percentage:3.0f}% [{remaining} remaining]',
disable=self.disable_progress,
dynamic_ncols=True,
)

def handle_failure(self, *, ex: Exception, message: str):
Expand Down
1 change: 1 addition & 0 deletions labtech/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(self, *, line_count: int):
self.pbars = [
tqdm(
bar_format='{desc}\033[K',
dynamic_ncols=True,
)
for _ in range(line_count)
]
Expand Down

0 comments on commit 82b7eec

Please sign in to comment.