question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] progress bar: bogus estimations

See original GitHub issue

The computation of the remaining time often produces bogus results for me. Here, when nesting two progress bars, I’m even getting negative times. MWE:

from rich.progress import Progress
import time

m = 10
n = 5

with Progress() as progress:
    task1 = progress.add_task("Overall", total=m)
    task2 = progress.add_task("Kernels", total=n)

    for _ in range(m):
        progress.update(task2, completed=0)
        for j in range(n):
            time.sleep(2 ** j)
            progress.update(task2, advance=1)
        progress.update(task1, advance=1)

screenshot

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
willmcgugancommented, Oct 23, 2020

Fixed in 9.1.0. Progress.reset is still the recommended way though.

1reaction
willmcgugancommented, Oct 21, 2020

It’s because completed is going backwards. Replace progress.update(task2, completed=0) with progress.reset(task2).

I’ll look in to doing an automatic reset when the value completed goes backwards.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] Incorrect time estimation in the progress bar #12875
Bug The progress bar shows the incorrect time estimation when epoch > 0: Epoch 0: : 910it [25:44, 1.70s/it] Epoch ... pyTorch_debug: False...
Read more >
Progress bars still lie - Hacker News
VSCode has a progress bar (well a throbber) that shows up when the language server has waited long enough that the UI should...
Read more >
Why are Progress Bars Always Wrong? Progress ... - YouTube
Patreon ➤ https://www.patreon.com/jacobsorberCourses ➤ https://jacobsorber.thinkific.comWebsite ➤ https://www.jacobsorber.com---Why are ...
Read more >
Crazy Progress Bars - DataGenetics
If you use computers, you've experienced progress bars. Progress bars are incredibly useful; they give feedback on the status of non-trivial tasks.
Read more >
Does Your Download Progress Bar Lie to You? - WIRED
In this plot, I weighted the estimate error based on how much data was left to download. So a 1-minute error at the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found