-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
initial= parameter seems not working properly #215
Comments
Hi,
On 27 Jul 2016 2:21 a.m., "Zhanzhao (Deo) Liang" [email protected]
|
import tqdm
from time import sleep
to_mongo_pbar = tqdm.trange(30, 100, desc='to Mongo', initial=30)
for i in tqdm.trange(30, 100, desc='imputed', initial=30):
sleep(0.1)
# do something else for to_mongo_pbar
to_mongo_pbar.update(1)
to_mongo_pbar.close() this is still failing, it starts at 30/70, continue to exeeds the remain 30 it , which I think it should be 30/100 to Mongo: 100it [00:07, 9.63it/s] |
ah sorry, the length of your iterable is 70, so you don't need for x in tqdm.trange(30, 100):
...
# or
for x in tqdm.tqdm(range(30, 100)):
... the displayed bar would go from 0/70 to 70/70. I think currently the only way to start at 30/100 and go to 100/100 (if that's what you really really really want) is: r = range(100)[30:]
for x in tqdm.tqdm(r, initial=30):
... either way, I've assumed you want x to start at 30 and finish at 99. |
He can also set the total manually, that's what I did (I often used
|
Please feel free to report if this solved your issue, or open it again if not! |
The range works perfectly the problem the iteration speed the iteration speed at the end counts from 0-100 instead of just from 30-100 |
for this snippet I would expect the iteration(i) start from 30 and finish at 99, however it extend the counter to 129
is it a bug or expected behaviour?
The text was updated successfully, but these errors were encountered: