Skip to content

Commit 1778879

Browse files
authored
Merge pull request #2857 from casperdcl/short-progress
lengthen bars unless nested/threaded
2 parents f142188 + 36fc2b0 commit 1778879

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

dvc/progress.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ class Tqdm(tqdm):
2020
"""
2121

2222
BAR_FMT_DEFAULT = (
23-
"{percentage:3.0f}%|{bar:10}|"
24-
"{desc:{ncols_desc}.{ncols_desc}}{n_fmt}/{total_fmt}"
23+
"{percentage:3.0f}% {desc}|{bar}|"
24+
"{n_fmt}/{total_fmt}"
25+
" [{elapsed}<{remaining}, {rate_fmt:>11}{postfix}]"
26+
)
27+
# nested bars should have fixed bar widths to align nicely
28+
BAR_FMT_DEFAULT_NESTED = (
29+
"{percentage:3.0f}%|{bar:10}|{desc:{ncols_desc}.{ncols_desc}}"
30+
"{n_fmt}/{total_fmt}"
2531
" [{elapsed}<{remaining}, {rate_fmt:>11}{postfix}]"
2632
)
2733
BAR_FMT_NOTOTAL = (
@@ -83,7 +89,11 @@ def __init__(
8389
)
8490
if bar_format is None:
8591
if self.__len__():
86-
self.bar_format = self.BAR_FMT_DEFAULT
92+
self.bar_format = (
93+
self.BAR_FMT_DEFAULT_NESTED
94+
if self.pos
95+
else self.BAR_FMT_DEFAULT
96+
)
8797
else:
8898
self.bar_format = self.BAR_FMT_NOTOTAL
8999
else:

0 commit comments

Comments
 (0)