pathsim.utils.progresstracker module

class pathsim.utils.progresstracker.ProgressTracker(logger=None, log_interval=10, **kwargs)[source]

Bases: object

Class that manages progress tracking by providing a generator interface that runs until an external condition is satisfied.

Parameters:
  • logger (logging.Logger) – logger instance

  • log_interval (int) – interval to log percentages, from 0 to 100

check(progress, success=False, **kwargs)[source]

Update the progress of the generator.

This method needs to be called within the iteration loop to update the looping condition and the internal tracking.

Parameters:
  • progress (float) – progress number between 0 and 1

  • success (bool) – True if the update step was successful, False otherwise