Skip to content

nested or positioned bars are broken #1139

@mgdelmonte

Description

@mgdelmonte
  • I have marked all applicable categories:
    • visual output bug
  • I have visited the [source website], and in particular read the [known issues]
  • I have searched through the [issue tracker] for duplicates
  • I have mentioned version numbers, operating system and environment, where applicable

Versions:

Windows 10
tqdm 4.59.0
sys.version 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)]
sys.platform win32

Mac OS Catalina 10.15.6
tqdm 4.59.0
sys.version 3.9.2
sys.platform darwin

Nested or positioned bars are not working. Visual output is either a series of scrolling bars, or bars that jump around. The current "nested bars" example at https://github.com/tqdm/tqdm#nested-progress-bars

from tqdm.auto import trange
from time import sleep

for i in trange(4, desc='1st loop'):
    for j in trange(5, desc='2nd loop'):
        for k in trange(50, desc='3rd loop', leave=False):
            sleep(0.01)

generates this on Windows:

C:\Users\Michael\Downloads>python test.py
1st loop:   0%|                                                                  | 0/4 [00:00<?, ?it/s]
2nd loop:   0%|                                                                  | 0/5 [00:00<?, ?it/s]

3rd loop:   0%|                                                                 | 0/50 [00:00<?, ?it/s]

3rd loop:  14%|███████▉                                                 | 7/50 [00:00<00:00, 68.50it/s]

3rd loop:  28%|███████████████▋                                        | 14/50 [00:00<00:00, 65.75it/s]

3rd loop:  42%|███████████████████████▌                                | 21/50 [00:00<00:00, 65.05it/s]

3rd loop:  56%|███████████████████████████████▎                        | 28/50 [00:00<00:00, 64.88it/s]

2nd loop:   0%|                                                                  | 0/5 [00:00<?, ?it/s]
1st loop:   0%|                                                                  | 0/4 [00:00<?, ?it/s]

On Mac, it generates bars that mostly work but which scroll down whenever loop2 completes, leaving a display that shows

2nd loop: 100%|███████████| 5/5 [00:03<00:00,  1.66it/s]
2nd loop: 100%|███████████| 5/5 [00:03<00:00,  1.66it/s]
2nd loop: 100%|███████████| 5/5 [00:03<00:00,  1.66it/s]
2nd loop: 100%|███████████| 5/5 [00:03<00:00,  1.66it/s]
1st loop: 100%|███████████| 4/4 [00:12<00:00,  3.03it/s]

Further testing shows that other examples using position, including both threading and multiprocessing examples, all produce broken output on both Windows and Mac.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions