You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---snip---
I'm having trouble formatting numbers in progress bars when using
unit_scale. Unfortunately, there doesn't seem to be a way to do this
without overriding a lot of code.
As shown in line 565 of /usr/lib/python3/dist-packages/tqdm/std.py, the str() method is being used to convert the floats to strings before
printing them.
Minimal working example:
import tqdm
import time
for i in tqdm.tqdm(range(7), unit_scale=1/7):
time.sleep(0.1)
print()
Hi,
we've got the following bug report in Debian that I'd like to relay here (https://bugs.debian.org/1069702):
---snip---
I'm having trouble formatting numbers in progress bars when using
unit_scale. Unfortunately, there doesn't seem to be a way to do this
without overriding a lot of code.
As shown in line 565 of /usr/lib/python3/dist-packages/tqdm/std.py, the
str()
method is being used to convert the floats to strings beforeprinting them.
Minimal working example:
Output for this code:
0%| | 0.0/1.0 [00:00<?, ?it/s]
14%|████▍ | 0.14285714285714285/1.0 [00:00<00:00, 1.42it/s]
29%|█████████▏ | 0.2857142857142857/1.0 [00:00<00:00, 1.42it/s]
43%|█████████████▎ | 0.42857142857142855/1.0 [00:00<00:00, 1.42it/s]
57%|██████████████████▎ | 0.5714285714285714/1.0 [00:00<00:00, 1.42it/s]
71%|██████████████████████▊ | 0.7142857142857142/1.0 [00:00<00:00, 1.42it/s]
86%|███████████████████████████▍ | 0.8571428571428571/1.0 [00:00<00:00, 1.42it/s]
100%|███████████████████████████████████████████████| 1.0/1.0 [00:00<00:00, 1.42it/s]
---snap---
Regards,
Daniel
The text was updated successfully, but these errors were encountered: