diplomat.processing.progress_bar.TQDMProgressBar

class diplomat.processing.progress_bar.TQDMProgressBar(total: Optional[int] = None, tqdm_prior: Optional[tqdm] = None)[source]

Bases: ProgressBar

A Concrete implementation of the ProgressBar API, uses TQDM to display progress.

__init__(total: Optional[int] = None, tqdm_prior: Optional[tqdm] = None)[source]

Create a new tqdm 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.

  • tqdm_prior – Optional tqdm progress bar. If not set, constructs a new tqdm progress bar using total to utilize internally. Otherwise, uses this as the internal tqdm progress bar, and ignores the total argument.

Methods

__init__([total, tqdm_prior])

Create a new tqdm 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.

close()[source]

Close the progress bar, disabling any additional updates.

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.

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.

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.