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

Show elapsed time when finished in rich.progress.track() #2659

Merged

Conversation

jankatins
Copy link
Contributor

@jankatins jankatins commented Nov 18, 2022

Before it was showing

Inserting nodes... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00

now it will show:

Inserting nodes... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:12:03

-> Now one can see the elapsed time without adding another way to measure that time...

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've adjusted the test for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Just added the appropriate parameter: TimeRemainingColumn(elapsed_when_finished=True), to the created columns.

@jankatins jankatins force-pushed the progress_track_show_elapsed_on_finish branch 3 times, most recently from 68e6685 to 9449111 Compare November 18, 2022 17:05
Before it was showing

```
Inserting nodes... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:00:00
```

now it will show:

```
Inserting nodes... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:12:03
```
@jankatins jankatins force-pushed the progress_track_show_elapsed_on_finish branch from 9449111 to bed8ee9 Compare November 18, 2022 17:08
@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2022

Codecov Report

Patch and project coverage have no change.

Comparison is base (1876380) 98.38% compared to head (f50385d) 98.38%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2659   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files          74       74           
  Lines        7930     7930           
=======================================
  Hits         7802     7802           
  Misses        128      128           
Flag Coverage Δ
unittests 98.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
rich/cells.py 100.00% <ø> (ø)
rich/progress.py 92.92% <ø> (ø)
rich/segment.py 98.72% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link

@SertugF SertugF left a comment

Choose a reason for hiding this comment

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

Normally it shows, estimated time to complete the progress. Making it show another kind of value(time spent for progress) after completion can be confusing for majority of users. That is the main reason its(elapsed_when_finished) default value is set to false. I find making it true is not logical.

@jankatins
Copy link
Contributor Author

The problem is that the 100% 0:00:00 final output is useless -> it's done, but how long did it take?. The best would be to change it to 100% (took xx:xx:xx). But that would mean a (slightly) bigger change.

@willmcgugan
Copy link
Collaborator

Does seem like a better default.

@willmcgugan willmcgugan merged commit ed5c41e into Textualize:master Mar 4, 2023
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.

4 participants