Update progress after iteration (fix #651)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
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).
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
2 files+60 added−19 removed
- tests:+39 added−0 removed
- other:+21 added−19 removed