New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[tqdm.rich] latest rich breaks the example #1306
Comments
I've also encountered that the progress bar doesn't reach all items. and the outcome is not even constant. i re-run same code and it finishes different positions. and, the example in file header doesn't even reach beyond 0. this is at least constantly the same.
|
interesting is that i updated my test to also include so the rich progressbar somehow related how often it is updated, so it omits refresh if walked too fast. i guess and lacks final repaint? |
@andrzejnovak do you have info in what rich version it worked? |
I think this is a duplicate of the same problem: |
I've downgraded rich as down as rich==9.6.0, I could not downgrade more as that's the version Progress.TimeElapsedColumn was first added: and the problem is still there. |
I've also downgraded tqdm down as tqdm==4.56.0 I could not downgrade more as that's the version tqdm.rich was added: so, the issue title is incorrect, this has never worked propertly, not just "latest" version. |
seems to me that
I added |
so added trace printing to each display call when progressbar was working: def display(self, *_, **__):
raise "trace"
and looking at update() code, the display() call is omitted if it progress goes too fast. and there's calls to display() in std.close, but not in rich.close: |
This fixed problem for me: |
#1395 merged, this can be closed |
@glensc I still have this problem, although in VS Code interactive Window. I'd appreciate it if you could try it out on VS Code: import time
from tqdm.rich import trange, tqdm
for i in trange(10):
time.sleep(0.2) |
@ma-sadeghi did you update to 4.66.4? |
Yes, |
works for me from terminal
Source# https://github.com/tqdm/tqdm/issues/1306#issuecomment-2092369446
from tqdm.rich import trange, tqdm
import time
it = trange(10)
for i in it:
print(f"i={i}")
time.sleep(0.1)
print("finished") |
Right, but as I mentioned, it doesn't work in the Interactive Window. Ctrl shift P, then look for Interactive Window, then run the snippet there |
There you go: Code_oQaD1yB10l.mp4 |
@ma-sadeghi see this comment, maybe this applies to you: |
Thanks for the useful link. Indeed, if I pass Line 129 in 7472295
with |
so, that's two users, previous user didn't provide reproducer (if you read that link I shared). so submit pr with a fix and fingers crossed that maintainer will accept it soon :) |
@glensc Right, I'll submit a PR soon. Thanks for helping figure out the root cause :-) |
The example doesn't finish after updating rich
The text was updated successfully, but these errors were encountered: