pymor.tools.progress¶
Module Contents¶
- class pymor.tools.progress.DummyProgressDisplay[source]¶
Bases:
ProgressDisplayDisplays multiple progress bars.
Methods
Add new progress bar for given task.
- add_task(label=None, total=None)[source]¶
Add new progress bar for given task.
- Parameters:
label – If not
None, the label to use for the progress bar for this task.total – If not
None, the total units of work to be performed by this task.
- Returns:
task – The
Taskobject representing the progress bar.
- class pymor.tools.progress.ProgressDisplay[source]¶
Bases:
abc.ABCDisplays multiple progress bars.
- abstract add_task(label=None, total=None)[source]¶
Add new progress bar for given task.
- Parameters:
label – If not
None, the label to use for the progress bar for this task.total – If not
None, the total units of work to be performed by this task.
- Returns:
task – The
Taskobject representing the progress bar.
- track(iterable, label=None, total=None)[source]¶
Track iteration over an iterable.
Consecutively yields the items of the iterable and updates the corresponding progress bar.
- Parameters:
iterable – The iterable to track.
label – If not
None, the label for the corresponding progress bar.total – If not
None, the the length of the iterable.
- class pymor.tools.progress.RichProgressDisplay[source]¶
Bases:
ProgressDisplayDisplays multiple progress bars.
Methods
Add new progress bar for given task.
- add_task(label=None, total=None)[source]¶
Add new progress bar for given task.
- Parameters:
label – If not
None, the label to use for the progress bar for this task.total – If not
None, the total units of work to be performed by this task.
- Returns:
task – The
Taskobject representing the progress bar.
- class pymor.tools.progress.Task(progress_display, id)[source]¶
A task corresponding to a progress bar.
Created by a
ProgressDisplay.Can be used as a context manager. In that case, the task is automatically
finishedwhen the context is left.
- pymor.tools.progress.add_task(label=None, total=None)[source]¶
Add new progress bar for given task to active
ProgressDisplay.- Parameters:
label – If not
None, the label to use for the progress bar for this task.total – If not
None, the total units of work to be performed by this task.
- Returns:
task – The
Taskobject representing the progress bar.
- pymor.tools.progress.get_progress_display()[source]¶
Returns the currently active
ProgressDisplay.
- pymor.tools.progress.track(iterable, label=None, total=None)[source]¶
Track iteration over an iterable in the active
ProgressDisplay.Consecutively yields the items of the iterable and updates the corresponding progress bar.
- Parameters:
iterable – The iterable to track.
label – If not
None, the label for the corresponding progress bar.total – If not
None, the the length of the iterable.