Replies: 4 comments 3 replies
-
Does the second paragraph here help? |
Beta Was this translation helpful? Give feedback.
-
It helps, but it doesn't fully cover. |
Beta Was this translation helpful? Give feedback.
-
Though its possible to customize the progress bar and use MofNColumns, it would be great to have this as an option is basic For example tqdm, shows M/N and also shows the rate at which the elements are progressing. In all my use cases, though having % of completion is nice, I want to see M/N and rate of progress. Number of files crunches, time to crunch a file. If this is out of box with If I only need progress bar I feel its easy to just wrap with tqdm instead of defining a progress bar in all my scripts. I would love to contribute to this if you see the merit in this. |
Beta Was this translation helpful? Give feedback.
-
You can write your own column by combining some existing code to achieve this: from rich.progress import ProgressColumn, Task, filesize
from rich.text import Text
class RateColumn(ProgressColumn):
"""Renders human readable processing rate."""
def render(self, task: "Task") -> Text:
"""Render the speed in iterations per second."""
speed = task.finished_speed or task.speed
if speed is None:
return Text("", style="progress.percentage")
unit, suffix = filesize.pick_unit_and_suffix(
int(speed),
["", "×10³", "×10⁶", "×10⁹", "×10¹²"],
1000,
)
data_speed = speed / unit
return Text(f"{data_speed:.1f}{suffix} it/s", style="progress.percentage") |
Beta Was this translation helpful? Give feedback.
-
I also realized that you can easily show transfer speed and file size over total file size information in progress bars, but I cannot find columns for the generalized case: elements over total elements and elements per second (speed).
It would make sense to have these columns readily available for general use.
I see that files could be the most common elements being tracked, but "elements" in general will be quite useful too.
Beta Was this translation helpful? Give feedback.
All reactions