bloqade-python icon indicating copy to clipboard operation
bloqade-python copied to clipboard

method to check if a batch task is complete

Open jon-wurtz opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. Given a (running or complete?) batch task, it is unclear if all of the jobs have returned all bitstrings and no further query to remote is needed

Describe the solution you'd like job.status() for batchtask, with the same functionality as for single tasks

Describe alternatives you've considered return np.logical_and([task.status() for task in job.tasks])

jon-wurtz avatar Oct 25 '23 16:10 jon-wurtz

Additionally, if the task report already has all bitstring measurements accounted for, there would be no need to query remote

jon-wurtz avatar Oct 25 '23 16:10 jon-wurtz

In general the status of the tasks is not simply just Queued and Completed there are actually around 8 possible states a task can be in so its hard to map communicate the general status of the batch in a single status. One thing you can do is filter a batch by status codes, e.g. if I want just completed tasks I can filter based on Completed status:

completed_tasks = batch.get_tasks("Completed")
missing_tasks = batch.remove_tasks("Completed")

also batch.tasks_metric() returns a pandas Dataframe that contains the current knowledge of the tasks in the batch so you can get more fine grain information about the batch from that object.

Additionally, if the task report already has all bitstring measurements accounted for, there would be no need to query remote

Thanks, we've already thought of that so we're all set!

weinbe58 avatar Oct 25 '23 17:10 weinbe58