biotransformers.utils.tqdm_utils

This module provides a ProgressBar that works with ray and tqdm. Each Ray workers update the progress bar remotly.

Module Contents

Classes

ProgressBarActor

ProgressBar

class biotransformers.utils.tqdm_utils.ProgressBarActor
counter :int
delta :int
event :asyncio.Event
update(self, num_items_completed: int)None

Updates the ProgressBar with the incremental number of items that were just completed.

async wait_for_update(self)Tuple[int, int]

Blocking call.

Waits until somebody calls update, then returns a tuple of the number of updates since the last call to wait_for_update, and the total number of completed items.

get_counter(self)int

Returns the total number of complete items.

class biotransformers.utils.tqdm_utils.ProgressBar(total: int, description: str = '')
progress_actor :ray.actor.ActorHandle
total :int
description :str
pbar :tqdm.tqdm
property actor(self)ray.actor.ActorHandle

Returns a reference to the remote ProgressBarActor.

When you complete tasks, call update on the actor.

print_until_done(self)None

Blocking call.

Do this after starting a series of remote Ray tasks, to which you’ve passed the actor handle. Each of them calls update on the actor. When the progress meter reaches 100%, this method returns.