misc#

class predict_backend.utils.misc.StepProgressTqdm(flow_metadata, total, starting_progress=0, target_progress=100, step_size=10, callback=None, call_super_update=True, init_update=None, **kwargs)#

Bases: tqdm

It is a tqdm wrapper that accept some parameters to update the front-end progress bar accordingly to the progress made in tqdm.

In addition to the classic tqdm init parameters it accepts a reference to the store interface and apply the update_progress call.

Parameters:
  • flow_metadata (Dict) – The flow metadata necessary to create a store interface.

  • total (int) – Number of elements.

  • starting_progress (Union[int, float]) – Progress starting point, defaults to 0.

  • target_progress (Union[int, float]) – It is the target progress the tqdm engine will reach, defaults to 100.

  • callback – Function that changes the default StepProgressTqdm manual update.

  • call_super_update (bool) – Whether by default the update method should call the default tqdm update method, defaults to True.

  • init_update (Optional[str]) – An optional first update string to display before the first iteration of the loop has completed, defaults to None.

  • **kwargs

    All the parameters the tqdm init exposes.

update(n=1)#

Override the base update method. Useful for manual updates. If no store is provided, it will only call the super.update implementation otherwise it will perform an update to the front-end, calling the update_progress function.

Parameters:

n – Default increment, defaults to 1.