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
Include a smoother unicode progress bar #38
Comments
isn't it already implemented? |
Yes it's the ascii=False option IIRC. But I don't know if it's implemented in a similar fashion (ie: if it's as smooth as the pip progress bar). |
I just checked, it's indeed the ascii=False option to force use the smooth unicode bar, but normally the default option ascii=None should automatically use the smooth unicode bar if available, and else the ascii bar if not available. So I suppose the OP did try in his terminal which didn't support unicode (eg, on Windows?). The unicode bar can always be used inside IPython/Jupyter so it's a better environment to test this feature. However, the provided links can be interesting to compare the implementation, and see if we can "steal" something maybe to enhance the smooth progress bar. |
The relevant lines for smooth bar management in tqdm: Lol look at pip's FillingSquaresBar, FillingCirclesBar and ShadyBar! Genius :D |
Ah, sorry for the fuss, it’s an invalid issue. from time import sleep
from tqdm import trange
for i in trange(1000):
sleep(0.01) Because of the default refresh rate of tqdm, (and being mislead by the current gif that’s from the previous version), I wrote this issue a bit too fast :\ Well done to all of the team, everything is better in that new tqdm! All the annoying issues are gone! (mostly: printing after an end of tqdm, the narrow width, this issue) |
My first flurry of contributions to this project included a smooth unicode progress bar and radical speed increases. My implementation (see above comment) was rather neater and faster than To force Unicode in your terminal (I have to do this in my cross-compiled debian distribution on my phone PYTHONIOENCODING=utf-8 python -c 'import tqdm; i=[j for j in tqdm.trange(int(1e8), leave=True)]' Still, thanks @BertrandBordage for using tqdm and suggesting improvements! You seemed to imply some things are still not fixed... Do create a new issue for anything else you can think of. |
@casperdcl yes that's also what I thought about the speed, surely pip's version is a hella lot slower since it uses class inheritance. Great job on this one :) |
(First of all, thanks for reviving this nice project :D )
A progress bar similar to the new one in pip could be nice, using these characters:
https://github.com/pypa/pip/blob/develop/pip/_vendor/progress/bar.py#L63
Pip detects if this smoother progress bar can be used, and otherwise falls back to the regular one (see pypa/pip#2231).
The text was updated successfully, but these errors were encountered: