tlc.core.utils.progress¶

Utilities for tracking progress of long-running tasks.

Module Contents¶

Functions¶

Function

Description

track

Create a progress bar for a sequence of items.

Data¶

Data

Description

T

API¶

T = TypeVar(...)¶
track(
sequence: Sequence[tlc.core.utils.progress.T] | Iterable[tlc.core.utils.progress.T],
description: str = '',
show_speed: bool = True,
total: float | None = None,
refresh_per_second: float | None = None,
update_period: float = 0.2,
delay: float = 0.5,
) Iterable[tlc.core.utils.progress.T]¶

Create a progress bar for a sequence of items.

Uses tqdm for progress display, which provides native support for nested progress bars, better notebook integration, and a familiar interface.

Parameters:
  • sequence – The sequence of items to iterate over.

  • description – The description to display.

  • show_speed – Show the speed of the progress bar (iterations per second).

  • total – The total number of items in the sequence.

  • refresh_per_second – The number of times per second to refresh the progress bar.

  • update_period – The minimum time between updates (maps to tqdm’s mininterval).

  • delay – Minimum time in seconds before showing the progress bar. Useful for skipping progress display on fast operations. Defaults to 0.5 seconds.

Returns:

An iterable that yields the items in the sequence whilst displaying a progress bar.