pymor.tools.progress

Module Contents

class pymor.tools.progress.DummyProgressDisplay[source]

Bases: ProgressDisplay

Displays multiple progress bars.

Methods

add_task

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 Task object representing the progress bar.

class pymor.tools.progress.ProgressDisplay[source]

Bases: abc.ABC

Displays multiple progress bars.

Methods

add_task

Add new progress bar for given task.

track

Track iteration over an iterable.

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 Task object 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: ProgressDisplay

Displays multiple progress bars.

Methods

add_task

Add new progress bar for given task.

TASK_LINGER_TIME = 2[source]
TASK_PANE_UPDATE_TIME = 2[source]
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 Task object 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 finished when the context is left.

Methods

finish

Mark task as finished.

update

Update progress of the task.

finish()[source]

Mark task as finished.

update(value, total=None)[source]

Update progress of the task.

Parameters:
  • value – The units of work that have been finished.

  • total – If not None a (new) value for the total number of unit of work to be performed.

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 Task object 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.

pymor.tools.progress.progress_display[source]