datumaro.components.progress_reporting#
Classes
Only one set of methods must be called: |
|
|
|
|
- class datumaro.components.progress_reporting.ProgressReporter[source]#
Bases:
object
- Only one set of methods must be called:
start - report_status - finish
iter
split
This class is supposed to manage the state of children progress bars and release of their resources, if necessary.
- iter(iterable: Iterable[T], *, total: int | None = None, desc: str | None = None) Iterable[T] [source]#
Traverses the iterable and reports progress simultaneously.
Starts and finishes the progress bar automatically.
- Parameters:
iterable – An iterable to be traversed
total – The expected number of iterations. If not provided, will try to use iterable.__len__.
desc – The status message
- Returns:
An iterable over elements of the input sequence
- split(count: int) Tuple[ProgressReporter, ...] [source]#
Splits the progress bar into few independent parts. In case of 0 must return an empty tuple.
This class is supposed to manage the state of children progress bars and release of their resources, if necessary.
- class datumaro.components.progress_reporting.NullProgressReporter[source]#
Bases:
ProgressReporter
- iter(iterable: Iterable[T], *, total: int | None = None, desc: str | None = None) Iterable[T] [source]#
Traverses the iterable and reports progress simultaneously.
Starts and finishes the progress bar automatically.
- Parameters:
iterable – An iterable to be traversed
total – The expected number of iterations. If not provided, will try to use iterable.__len__.
desc – The status message
- Returns:
An iterable over elements of the input sequence
- split(count: int) Tuple[ProgressReporter] [source]#
Splits the progress bar into few independent parts. In case of 0 must return an empty tuple.
This class is supposed to manage the state of children progress bars and release of their resources, if necessary.
- class datumaro.components.progress_reporting.SimpleProgressReporter(period: float = 0.1, interval: float = inf)[source]#
Bases:
ProgressReporter
- class datumaro.components.progress_reporting.TQDMProgressReporter(period: float = 0.1, interval: float = 0.1, **options)[source]#
Bases:
ProgressReporter