Skip to content
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

Show start value of trange as initial value #898

Open
cmpute opened this issue Feb 17, 2020 · 6 comments
Open

Show start value of trange as initial value #898

cmpute opened this issue Feb 17, 2020 · 6 comments
Assignees
Labels
question/docs ‽ Documentation clarification candidate

Comments

@cmpute
Copy link

cmpute commented Feb 17, 2020

This is a new feature request
Tqdm ver: 4.42.1
Python ver: 3.6.10
OS: Ubuntu

Currently if we use trange(a,b), it shows a progressbar starting from 0 with total b-a steps. But intuitively I expect a progressbar starting from a with total b steps. That is trange(a,b) should be equivalent to tqdm(initial=a, total=b). Does this make sense?

@cmpute cmpute changed the title Show start value of range as initial value Show start value of trange as initial value Feb 17, 2020
@casperdcl
Copy link
Sponsor Member

You can do trange(a, b, initial=a)...

@casperdcl casperdcl self-assigned this Feb 17, 2020
@casperdcl casperdcl added the question/docs ‽ Documentation clarification candidate label Feb 17, 2020
@cmpute
Copy link
Author

cmpute commented Feb 18, 2020

Oh cool, didn't think of that

@cmpute
Copy link
Author

cmpute commented Feb 18, 2020

But actually it's equivalent to trange(a, b, initial=a, total=b)... Isn't this too redundant?

@casperdcl
Copy link
Sponsor Member

Arguably both inital and total are redundant in your use case, but I don't think they should be inferred from a and b by default.

If we auto-infer then everyone using trange(a, b) will also get a bar starting at a/(b-a)*100% complete which is not usually what people want

@cmpute
Copy link
Author

cmpute commented Feb 18, 2020

Maybe add an option for auto-infer is great, like trange(a, b, infer_start=True)

@yzy1996
Copy link

yzy1996 commented May 27, 2023

trange(a, b, initial=a, total=b) is what I need. Thanks!

Where can I find the full parameters document?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question/docs ‽ Documentation clarification candidate
Projects
None yet
Development

No branches or pull requests

3 participants