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
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 199 |
|
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
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 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 |
|
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"]