tqdm/tqdm

Jupyter-notebook: bar freezes then updates after a while

Opened this issue · 0 comments

Hi all, I notice a weird behaviour in jupyter notebooks.

The bar seems to work fine until the last iteration, then freezes (even though the cell is done running):
image

Then, after a little while, the bar updates itself:

image

MWE:

import tqdm.auto
import time

final_time = 100
progress = tqdm.auto.tqdm(
    desc="Title",
    total=final_time,
    unit_scale=True,
)
dt = 11
t = 0
while t < final_time:
    dt = min(dt, abs(final_time - t))

    progress.update(dt)
    t += dt
    time.sleep(0.1)
  • I have marked all applicable categories:
    • exception-raising bug
    • 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:
    4.66.2 3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:50:58) [GCC 12.3.0] linux