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_progress enhancements #604

merged 2 commits into from Jul 5, 2015


None yet
1 participant

jabooth commented Jul 5, 2015

This PR makes print_progress() more flexible by adding a number of keyword arguments:

  1. show_items=True: Useful to reuse print_progress on generators where the count itself is not of great significance. For instance, we use this in menpobench to report download progress. Each item here is a chunk of bytes which is not relevant:
  2. show_eta=True: Useful to hide ETA for shorter running jobs
  3. show_bar=True: Useful to hide bar on progress reports with long prefixes.

This also improves print_dynamic() to use the print() function, and has an automatic flushing behaviour - the first 80 characters of a previous dynamic line are cleared, which should remove some overlayed dynamic string issues.

Following this PR we can aim to use print_progress() throughout the Menpo libraries, unifying our approach to dynamically reporting progress over iterables.

@jabooth jabooth added the in progress label Jul 5, 2015

@jabooth jabooth changed the title from optionally hide item count in print_progress to print_progress enhancements Jul 5, 2015


This comment has been minimized.


jabooth commented Jul 5, 2015

currently heavily working on menpobench and this is needed, so going to get it in. Happy to revisit if anyone wants to tweak any behaviour.

jabooth added a commit that referenced this pull request Jul 5, 2015

@jabooth jabooth merged commit 1aba4d0 into menpo:master Jul 5, 2015

3 checks passed

clahub All contributors have signed the Contributor License Agreement.
continuous-integration/appveyor AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@jabooth jabooth removed the in progress label Jul 5, 2015

@jabooth jabooth deleted the jabooth:progress_bar_no_items branch Jul 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment