diplomat.processing.progress_bar.ProgressBar

class diplomat.processing.progress_bar.ProgressBar(total: Optional[int] = None)[source]

Bases: ABC

Abstract API for representing a progress bar. Used by predictors for displaying progress info.

abstract __init__(total: Optional[int] = None)[source]

Create a new progress bar.

Parameters:

total – An optional integer, the total number of steps that need to be completed. If set to None progress bar disables completion percentage features and simply keeps track of the number of iterations done.

Methods

__init__([total])

Create a new progress bar.

close()

Close the progress bar, disabling any additional updates.

message(message)

Set the description message for the progress bar.

reset([total])

Reset the progress bar with a new total value to reach.

update([amt])

Perform a progress bar update, increasing the number of iterations done.

abstract close()[source]

Close the progress bar, disabling any additional updates.

abstract message(message: str)[source]

Set the description message for the progress bar.

Parameters:

message – A string, the message to include with or above the progress bar. Can be used to describe the current state a process is in.

abstract reset(total: Optional[int] = None)[source]

Reset the progress bar with a new total value to reach.

Parameters:

total – An optional integer, the total number of steps that need to be completed. If set to None progress bar disables completion percentage features and simply keeps track of the number of iterations done.

abstract update(amt: int = 1)[source]

Perform a progress bar update, increasing the number of iterations done.

Parameters:

amt – The number of iterations or steps done, to increase the progress bar by. Defaults to 1.