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] time remaining estimate doesn't work on slow tasks

See original GitHub issue

Describe the bug

the TimeRemainingColumn() never shows an estimate if the task is slower than speed_estimate_period (default 30 seconds)

code to reproduce:

import time
import rich.progress

p = rich.progress.Progress(
	*rich.progress.Progress.get_default_columns(),
	rich.progress.TimeElapsedColumn()
)

task = p.add_task(description='test')

with p:
	for i in p.track(range(20), task_id=task):
		time.sleep(60)

this happens because of this code: https://github.com/Textualize/rich/blob/1772458f80924c78fa3a8d0260bca9762ad86e18/rich/progress.py#L1441-L1446

the progresssamples older than speed_estimate_period are removed from the queue before a speed estimate can be calculated.

I’m using rich-12.4.1 on linux.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
0phoffcommented, Oct 12, 2022

Sorry for commenting on this closed issue, but would it be an option to allow speed_estimate_period to be set to None or -1 to disable this filter ? I quickly looked through the code and it seems pretty trivial to add. I am willing to implement it and send a PR, but wanted to know if @willmcgugan likes the idea or not.

The reason for adding this is that we sometimes have very consistent processes (eg. a Deep Learning training epoch) that still take hours to complete. In these scenarios it is nice to have an estimate finishing time, even if it is not super accurate (most DL users know to take these estimates with a grain of salt, but it is still nice to have them!). As the time per epoch varies drastically depending on dataset size, model choice, and compute platform, it is virtually impossible to find a good value for speed_estimate_period. I could set it to a ridicule number, but IMO it is nicer if the API allows you to set it to None to disable it.

The default value would still be unchanged (30sec), but this allows “more advanced” users to get around it. Since multiple columns depend on this Speed computation, it is easier to add it as an option to Rich, rather than having a user reimplement (TimeRemainingColumn, SpeedColumn, etc) to work around it.

0reactions
github-actions[bot]commented, Jun 14, 2022

Did I solve your problem?

Why not buy the devs a coffee to say thanks?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why We're Bad at Estimating Time (and What to Do About It)
If you work alone, a simple way to do this is by using a time tracking app. Use the app to track how...
Read more >
Remaining time estimate doesn't get updated
We have recently encountered a problem that the remaining time estimate has stopped updating as it usually did before - Original estimate ......
Read more >
Why doesn't Windows' 'estimated time remaining' ever work?
Estimating the time remaining is affected by a great many things on the system. ... Open Up task Manager and run the process...
Read more >
“Estimating Time Remaining” iOS 15 Update Stuck? Fix it Now!
In this article, I'll explain exactly how to fix “estimating time remaining” iOS 15 issue for good! Before you try the solutions given...
Read more >
How To Clean and Disinfect Schools To Help Slow the Spread ...
This process does not necessarily clean dirty surfaces or remove germs, ... the product to remain on the surface for a certain period...
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