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

print/get final nested progbar stats iterations/sec #660

Closed
3 tasks done
ahundt opened this issue Jan 19, 2019 · 2 comments
Closed
3 tasks done

print/get final nested progbar stats iterations/sec #660

ahundt opened this issue Jan 19, 2019 · 2 comments
Assignees
Labels
duplicate 🗐 Seen it before p3-enhancement 🔥 Much new such feature question/docs ‽ Documentation clarification candidate

Comments

@ahundt
Copy link

ahundt commented Jan 19, 2019

  • I have visited the [source website], and in particular
    read the [known issues]
  • I have searched through the [issue tracker] for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable:
    import tqdm, sys
    print(tqdm.__version__, sys.version, sys.platform)

I'd like to get final stats from a nested progbar such as:

  • it/s
  • total time
  • total steps

It seems tqdm(leave=True) by default, but only the outer progbar rather than nested progbars leave anything behind. Another alternative would be to have a way to get the final stats out of the tqdm progbar after it is done iterating, and I could write them out myself.

Is this doable?

Slightly related issue:
#230

Side note: I've been using tqdm all the time for years now. It is pretty amazing, thanks!

@casperdcl
Copy link
Sponsor Member

casperdcl commented Jan 19, 2019

think this is a duplicate of #562.

For now you can:

for x in tqdm(...):
    with tqdm(...) as nested:
        for y in nested:
            ...
        stats = str(nested)
        # now parse/extract info from `stats`

@ahundt
Copy link
Author

ahundt commented Jan 23, 2019

thanks, that seems like it will do the trick for now

@casperdcl casperdcl self-assigned this Jan 23, 2019
@casperdcl casperdcl added duplicate 🗐 Seen it before question/docs ‽ Documentation clarification candidate p3-enhancement 🔥 Much new such feature labels Jan 23, 2019
casperdcl added a commit that referenced this issue Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate 🗐 Seen it before p3-enhancement 🔥 Much new such feature question/docs ‽ Documentation clarification candidate
Projects
None yet
Development

No branches or pull requests

2 participants