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

[REQUEST] All or nothing progress bar showing indeterminate state with elapsed time #3572

Open
peterjc opened this issue Nov 22, 2024 · 2 comments

Comments

@peterjc
Copy link

peterjc commented Nov 22, 2024

I have a mixture of tasks which I want to display, most of which I can update the progress for, and am showing the elapsed time and NofM:

PROGRESS_BAR_COLUMNS = [
    TextColumn("[progress.description]{task.description}"),
    BarColumn(),
    TaskProgressColumn(),
    # Removing TimeRemainingColumn() from defaults, replacing with:
    TimeElapsedColumn(),
    # Add this last as have some out of N and some out of N^2:
    MofNCompleteColumn(),
]

This gives me something like this, starting with an empty (grey) bar, then a red partly filled bar, and finally a full green bar:

Indexing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━   0% 0:00:00  0/10
Indexing ━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  20% 0:00:18  2/10
Indexing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━  90% 0:00:58  9/10
Indexing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 0:01:00 10/10

That is all good so far.

However, some tasks have a known number of steps (say 10), but I cannot monitor their progress, so what to show the indeterminate animated state AND the elapsed time, and then when finished show the standard green 100% bar:

Screenshot 2024-11-22 at 15 43 19

I can get the indeterminate state using start=False, but then the elapsed time does not show:

Screenshot 2024-11-22 at 15 35 46

In ASCII art:

Indexing ━━━━━<<━━>>━━━━━━━<<━>>━━━━━━━━<<━>>━━━━   0% -:--:--  0/10

I can get the indeterminate state using total=None, but I do have a value, and would like the % place holder.

Screenshot 2024-11-22 at 15 41 07

In ASCII art total=None gave:

Indexing ━━━━━<<━━>>━━━━━━━<<━>>━━━━━━━━<<━>>━━━━  0:00:10  0/?

I'd like something like that visually but with the time, and perhaps ?/total at the end:

Indexing ━━━━━<<━━>>━━━━━━━<<━>>━━━━━━━━<<━>>━━━━   0% 0:01:23  ?/10

Is this currently not possible? Thank you!

Tested with rich 13.9.4 on Python 3.12 on macOS.

Copy link

Thank you for your issue. Give us a little time to review it.

PS. You might want to check the FAQ if you haven't done so already.

This is an automated reply, generated by FAQtory

@peterjc
Copy link
Author

peterjc commented Nov 22, 2024

Perhaps TaskProgressColumn should show ?% for indeterminate?

Indexing ━━━━━<<━━>>━━━━━━━<<━>>━━━━━━━━<<━>>━━━━   ?% 0:01:23  ?/10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant