Home
Overview
Fundamentals
Glossary
Cheatsheet
API Reference
Quick Recipes
Deep Dive
Common Pitfalls and Gotchas
Persistent Storage
Immutable snapshot of tqdm progress state.
This mirrors the information available via `tqdm.format_dict` and can be
round-tripped through the `ProgressRecord` proto for serialization over
RPCs, storage, or inter-process communication.
Attributes:
n: Number of items completed.
total: Total number of items, or `None`/`0` if the bar is indeterminate
(e.g., pulling from a generator). Indeterminate bars will still show
iterations and rate, but not a total or ETA.
elapsed_secs: Seconds elapsed since the progress bar started.
rate: Processing rate in items/s (EMA-smoothed), or `None` if unavailable.
initial: Starting counter value (usually 0).
unit: Unit label (e.g. "it", "batch", "step").
desc: Description prefix set by the user.
postfix: Postfix string set by the user.
bar_id: Unique identifier for the progress bar.
is_closed: True if the progress bar has been closed.
is_displayed: True if the progress bar should be displayed (usually False
if closed and `leave=False` or if `disable=True`).
ProgressState.__init__(self, n: float | None = None, total: float | None = None, elapsed_secs: float = 0.0, rate: float | None = None, initial: float = 0.0, unit: str = 'it', desc: str | None = None, postfix: str | None = None, bar_id: str = '', is_closed: bool = False, is_displayed: bool = True) -> NoneInitialize self. See help(type(self)) for accurate signature.
ProgressState.bar_id''
ProgressState.descNone
ProgressState.elapsed_secs0.0
ProgressState.fractionProgress fraction, computed as `n / total`.
ProgressState.from_proto(ps: ProgressRecord) -> SelfConstructs a ProgressState from a `ProgressRecord` proto.
ProgressState.from_tqdm(fmt: dict[str, Any], bar_id: str, is_closed: bool, is_displayed: bool) -> SelfConstructs a ProgressState from a tqdm `format_dict`.
ProgressState.initial0.0
ProgressState.is_closedFalse
ProgressState.is_displayedTrue
ProgressState.nNone
ProgressState.postfixNone
ProgressState.rateNone
ProgressState.remaining_sEstimated seconds until completion, or None if rate is unknown.
ProgressState.to_proto(self) -> ProgressRecordSerializes this ProgressState to a `ProgressRecord` proto.
ProgressState.totalNone
ProgressState.unit'it'