Skip to content

Commit

Permalink
no unit scaling for small totals
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Jan 26, 2020
1 parent 5d10606 commit c6c8b80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dvc/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def __init__(
bar_format=None,
bytes=False, # pylint: disable=W0622
file=None,
total=None,
**kwargs
):
"""
Expand All @@ -61,9 +62,10 @@ def __init__(
kwargs : anything accepted by `tqdm.tqdm()`
"""
kwargs = kwargs.copy()
kwargs.setdefault("unit_scale", True)
if bytes:
kwargs = merge(self.BYTES_DEFAULTS, kwargs)
else:
kwargs.setdefault("unit_scale", total > 999 if total else True)
if file is None:
file = sys.stderr
self.desc_persist = desc
Expand All @@ -84,6 +86,7 @@ def __init__(
desc=desc,
bar_format="!",
lock_args=(False,),
total=total,
**kwargs
)
if bar_format is None:
Expand Down
2 changes: 0 additions & 2 deletions dvc/repo/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def add(repo, targets, recursive=False, no_commit=False, fname=None):
stage.dump()

stages_list += stages
# remove filled bar bit of progress, leaving stats
pbar.bar_format = pbar.BAR_FMT_DEFAULT.replace("|{bar:10}|", " ")

return stages_list

Expand Down

0 comments on commit c6c8b80

Please sign in to comment.