diplomat.processing.ProgressBar
- class diplomat.processing.ProgressBar(total: int | None = None)[source]
Bases:
ABCAbstract API for representing a progress bar. Used by predictors for displaying progress info.
- abstractmethod __init__(total: int | None = 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.
- abstractmethod 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.
- abstractmethod reset(total: int | None = 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.