Batch
Filter ¶
filter_metadata ¶
Create a Batch object that has tasks filtered based on the values of metadata.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
__match_any__ | bool | if True, then a task will be included if it matches any of the metadata filters. If False, then a task will be included only if it matches all of the metadata filters. Defaults to False. | False |
**metadata | MetadataFilterType | the metadata to filter on. The keys are the metadata names and the values (as a set) are the values to filter on. The elements in the set can be Real, Decimal, Tuple[Real], or Tuple[Decimal]. | {} |
Return
type(self): a Batch object with the filtered tasks, either LocalBatch or RemoteBatch depending on the type of self
Source code in src/bloqade/task/batch.py
LocalBatch dataclass
¶
Bases: Serializable
, Filter
report ¶
Generate analysis report base on currently completed tasks in the LocalBatch.
Return
Report
Source code in src/bloqade/task/batch.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
|
rerun ¶
Rerun all the tasks in the LocalBatch.
Return
Report
Source code in src/bloqade/task/batch.py
RemoteBatch dataclass
¶
Bases: Serializable
, Filter
total_nshots property
¶
Total number of shots of all tasks in the RemoteBatch
Return
number of shots
cancel ¶
Cancel all the tasks in the Batch.
Return
self
fetch ¶
Fetch the tasks in the Batch.
Note
Fetching will update the status of tasks, and only pull the results for those tasks that have completed.
Return
self
Source code in src/bloqade/task/batch.py
get_completed_tasks ¶
Create a RemoteBatch object that contain completed tasks from current Batch.
Tasks consider completed with following status codes:
- Completed
- Partial
Return
RemoteBatch
Source code in src/bloqade/task/batch.py
get_failed_tasks ¶
Create a RemoteBatch object that contain failed tasks from current Batch.
failed tasks with following status codes:
- Failed
- Unaccepted
Return
RemoteBatch
Source code in src/bloqade/task/batch.py
get_finished_tasks ¶
Create a RemoteBatch object that contain finished tasks from current Batch.
Tasks consider finished with following status codes:
- Failed
- Unaccepted
- Completed
- Partial
- Cancelled
Return
RemoteBatch
Source code in src/bloqade/task/batch.py
get_tasks ¶
Get Tasks with specify status_codes.
Return
RemoteBatch
Source code in src/bloqade/task/batch.py
pull ¶
Pull results of the tasks in the Batch.
Note
Pulling will pull the results for the tasks. If a given task(s) has not been completed, wait until it finished.
Return
self
Source code in src/bloqade/task/batch.py
remove_failed_tasks ¶
Create a RemoteBatch object that contain tasks from current Batch, with failed tasks removed.
failed tasks with following status codes:
- Failed
- Unaccepted
Return
RemoteBatch
Source code in src/bloqade/task/batch.py
remove_invalid_tasks ¶
Create a RemoteBatch object that contain tasks from current Batch, with all Unaccepted tasks removed.
Return
RemoteBatch
Source code in src/bloqade/task/batch.py
remove_tasks ¶
Remove Tasks with specify status_codes.
Return
RemoteBatch
Source code in src/bloqade/task/batch.py
report ¶
Generate analysis report base on currently completed tasks in the RemoteBatch.
Return
Report
Source code in src/bloqade/task/batch.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 |
|
resubmit ¶
Resubmit all the tasks in the RemoteBatch
Return
self
Source code in src/bloqade/task/batch.py
retrieve ¶
Retrieve missing task results.
Note
Retrieve will update the status of tasks, and only pull the results for those tasks that have completed.
Return
self
Source code in src/bloqade/task/batch.py
tasks_metric ¶
Get current tasks status metric
Return
dataframe with ["task id", "status", "shots"]