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

improved eta #4271

Merged
merged 17 commits into from
Mar 18, 2024
Merged

improved eta #4271

merged 17 commits into from
Mar 18, 2024

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Mar 7, 2024

Improved ETA for progress bar

  • Reduces refreshes of the ProgressBar. Previously the widget would repaint every time update was called. Even if the output remained the same.
  • Improved calculation of ETA based on recent samples. ETA is extrapolated based on this speed.
  • Added a Clock object to return relative time, and allow for easier mocking. This is public, but as yet undocumented. This might become a public interface if we want devs to be able to swap out algorithms.

Closes #4054

@willmcgugan willmcgugan marked this pull request as draft March 7, 2024 16:33
@davep davep linked an issue Mar 11, 2024 that may be closed by this pull request
@willmcgugan willmcgugan marked this pull request as ready for review March 15, 2024 14:04
Copy link
Contributor

@davep davep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple or so things worth a wee note and perhaps a tweak.

src/textual/eta.py Show resolved Hide resolved
src/textual/eta.py Outdated Show resolved Hide resolved
src/textual/widgets/_progress_bar.py Outdated Show resolved Hide resolved
@willmcgugan willmcgugan merged commit 0ce3f43 into main Mar 18, 2024
20 checks passed
@willmcgugan willmcgugan deleted the eta branch March 18, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revised progress bar ETA
2 participants