-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Description
If there are enough steps in the loop so that the increment is small enough, it can happen that tqdm
shows 100%
even though the process hasn't finished yet. This is the default behavior and I think it should be changed to stop at 99% before actually finishing.
MVE:
from time import sleep
from tqdm.cli import tqdm
n = 1000
for idx in tqdm(range(n)):
if idx == n-1:
break
sleep(1/n)
I know it's possible to change the bar format to show decimals, e.g.
from time import sleep
from tqdm.cli import tqdm
n = 1000
for idx in tqdm(range(n), bar_format = "{desc}: {percentage:.1f}%|{bar}| {n_fmt}/{total_fmt} [{elapsed}<{remaining}]"):
if idx == n-1:
break
sleep(1/n)
but this probably isn't an acceptable solution for everyone.
taoroalin
Metadata
Metadata
Assignees
Labels
No labels