AI junk#3682
Closed
OneNobleSoul wants to merge 1 commit into
Closed
Conversation
A trailing interval smaller than update_min_steps was never flushed, so a bar with show_pos=True could finish showing e.g. 18/20 at 100%. update() now also renders when the position reaches the length. fixes #3571
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #3571.
ProgressBar.update()only flushes accumulated steps once_completed_intervalsreachesupdate_min_steps. A trailing interval smaller than that threshold was never applied, so a bar usingshow_pos=Truecould finish showing a stale position — e.g.18/20while the percentage already reads100%.update()now also flushes when the position reaches the length, so the final step is always rendered. This covers both the generator and the manualbar.update()paths.tests/test_termui.pythat fails without the change (feeds 20 single steps withupdate_min_steps=6and asserts the bar ends at20/20).CHANGES.mdentry and aversionchangednote onupdate().Verified locally:
pytest tests/test_termui.py(222 passed), ruff and mypy clean.