tomodrgn.utils.print_progress_bar#

print_progress_bar(curr_iteration: int, num_iterations: int, prefix: str = '', suffix: str = '', decimals: int = 1, length: int = 100, fill: str = '*', end_character: str = '\r') None[source]#

Display an ASCII progress bar in STDOUT. Display format is: PREFIX |*****—–| 50.0% SUFFIX, updated in-place at STDOUT. Intended method of use is calling this function repeatedly within a loop with updated curr_iteration. The final call in which curr_iteration == num_iterations updates the progress bar (in place) and adds a newline for subsequent output.

Parameters:
  • curr_iteration – the current step number through the process being monitored.

  • num_iterations – the total number of steps in the process being monitored.

  • prefix – text to be prepended before the progress bar.

  • suffix – text to by appended after the progress bar.

  • decimals – the number of decimals to show in the % completion text of the progress bar.

  • length – the number of characters defining the length of the progress bar. Does not change to preserve a constant display width if prefix, suffix, or decimals change.

  • fill – the character used to denote the completed portion of the progress bar.

  • end_character – the character at the end of the progress bar, typically carraige return or newline.

Returns:

None