-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update progress after iteration (fix #651)
Reported "off by one" error is due to the fact that an interator is used instead of a generator. As such there is no way for the bar to know when it has iterated over the user's code block. This commit swaps the iterator for a generator, and changes _when_ the status report is updated, from before each iteration of a user's code block, to _after_. Updating the status report after the user's code has run allows the report to convey how much work has been _done_ so far. Accidental gain: The associated unit test performs a black-box test on the generated progress output. This test revealed a bug in the ETA time calculation were the behavior differed between python 2 and 3, causing the unit test to fail on python 3. The remedy employed to allow passing of the test is to use integer division for the ETA calculation, which should also address a related issue (fixes #485).
- Loading branch information
Showing
2 changed files
with
60 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters