Local storage
DictStorage dataclass
DictStorage()
Bases: StorageBackend
flowchart TD
bloqade.core.device.local_storage.DictStorage[DictStorage]
bloqade.core.device.local_storage.StorageBackend[StorageBackend]
bloqade.core.device.local_storage.StorageBackend --> bloqade.core.device.local_storage.DictStorage
click bloqade.core.device.local_storage.DictStorage href "" "bloqade.core.device.local_storage.DictStorage"
click bloqade.core.device.local_storage.StorageBackend href "" "bloqade.core.device.local_storage.StorageBackend"
In-memory storage backend for shot results.
This backend is useful for tests, examples, and short-lived sessions. Data is not persisted across Python processes.
add_shots
add_shots(shots: Iterable[ShotResult]) -> None
Store shot result rows in memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shots | Iterable[ShotResult] | Shot rows to store. | required |
Source code in src/bloqade/core/device/local_storage.py
446 447 448 449 450 451 452 453 454 455 456 457 458 | |
add_task_definition
add_task_definition(
task_id: str,
task_definition: TaskDefinition,
creation_time: datetime,
)
Store a task definition and creation time in memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
task_definition | TaskDefinition | Task definition to store. | required |
creation_time | datetime | Backend task creation time. | required |
Source code in src/bloqade/core/device/local_storage.py
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | |
get_program_language
get_program_language(task_id: str) -> str
Return the program language for a stored task definition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Stored program language. |
Raises:
| Type | Description |
|---|---|
KeyError | If |
Source code in src/bloqade/core/device/local_storage.py
574 575 576 577 578 579 580 581 582 583 584 585 586 | |
get_programs
get_programs(
task_ids: tuple[str, ...] | None = None,
) -> list[dict]
Return stored program records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_ids | tuple[str, ...] | None | Optional task IDs to include. When None, programs for all stored tasks are returned. Defaults to None. | None |
Returns:
| Type | Description |
|---|---|
list[dict] | list[dict]: Independent program dictionaries. |
Source code in src/bloqade/core/device/local_storage.py
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 | |
get_shots
get_shots(
*, shot_filter: ShotFilter | None = None
) -> Iterable[ShotResult]
Return in-memory shot rows matching a filter.
Other Parameters:
| Name | Type | Description |
|---|---|---|
shot_filter | ShotFilter | None | Optional shot filter. When None, all shots are returned. Defaults to None. |
Returns:
| Type | Description |
|---|---|
Iterable[ShotResult] | Iterable[ShotResult]: Matching shot rows. |
Source code in src/bloqade/core/device/local_storage.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | |
get_subtasks
get_subtasks(
storage_filter: StorageFilter | None = None,
) -> list[dict]
Return stored subtask records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage_filter | StorageFilter | None | Optional metadata filter. When None, all subtasks are returned. Defaults to None. | None |
Returns:
| Type | Description |
|---|---|
list[dict] | list[dict]: Independent subtask dictionaries. |
Source code in src/bloqade/core/device/local_storage.py
632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | |
get_task_creation_time
get_task_creation_time(task_id: str) -> datetime.datetime
Return the creation time for a stored task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
Returns:
| Type | Description |
|---|---|
datetime | datetime.datetime: Stored task creation time. |
Raises:
| Type | Description |
|---|---|
KeyError | If |
Source code in src/bloqade/core/device/local_storage.py
588 589 590 591 592 593 594 595 596 597 598 599 600 | |
get_task_group_id
get_task_group_id(task_id: str) -> UUID | None
Return the QLAM group stored for a task definition.
Source code in src/bloqade/core/device/local_storage.py
602 603 604 605 606 607 | |
task_ids
task_ids() -> set[str]
Return task IDs with stored task definitions.
Returns:
| Type | Description |
|---|---|
set[str] | set[str]: Stored task IDs. |
Source code in src/bloqade/core/device/local_storage.py
509 510 511 512 513 514 515 516 517 518 519 | |
update_subtasks_completed_date
update_subtasks_completed_date(
task_id, subtasks: list[dict]
) -> None
Update completion times for stored subtasks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
subtasks | list[dict] | API subtask dictionaries containing | required |
Source code in src/bloqade/core/device/local_storage.py
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 | |
SQLiteStorage
SQLiteStorage(db_file: str)
Bases: StorageBackend
flowchart TD
bloqade.core.device.local_storage.SQLiteStorage[SQLiteStorage]
bloqade.core.device.local_storage.StorageBackend[StorageBackend]
bloqade.core.device.local_storage.StorageBackend --> bloqade.core.device.local_storage.SQLiteStorage
click bloqade.core.device.local_storage.SQLiteStorage href "" "bloqade.core.device.local_storage.SQLiteStorage"
click bloqade.core.device.local_storage.StorageBackend href "" "bloqade.core.device.local_storage.StorageBackend"
SQLite-backed storage for shot results.
Use this backend to persist shots and task metadata across Python sessions. When used with a future, close the connection after fetching is complete, for example:
with SQLiteStorage("my_database.sql") as store:
future = task.run_async(..., storage=store)
Otherwise, garbage collection closes the connection later, which may keep the file lock open longer than expected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_file | str | Path to the SQLite database file. | required |
Raises:
| Type | Description |
|---|---|
ValueError | If the stored schema version does not match this package's expected schema version. |
Source code in src/bloqade/core/device/local_storage.py
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 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 | |
__enter__
__enter__()
Return this storage backend for use as a context manager.
Returns:
| Name | Type | Description |
|---|---|---|
SQLiteStorage | This storage instance. |
Source code in src/bloqade/core/device/local_storage.py
1194 1195 1196 1197 1198 1199 1200 | |
__exit__
__exit__(type, value, traceback)
Close the SQLite connection when leaving a context manager.
Source code in src/bloqade/core/device/local_storage.py
1202 1203 1204 | |
add_shots
add_shots(shots: Iterable[ShotResult]) -> None
Store shot result rows in SQLite.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shots | Iterable[ShotResult] | Shot rows to store. | required |
Source code in src/bloqade/core/device/local_storage.py
826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 | |
add_task_definition
add_task_definition(
task_id: str,
task_definition: TaskDefinition,
creation_time: datetime,
)
Store a task definition and creation time in SQLite.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
task_definition | TaskDefinition | Task definition to store. | required |
creation_time | datetime | Backend task creation time. | required |
Source code in src/bloqade/core/device/local_storage.py
979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 | |
close
close()
Close the SQLite connection.
Source code in src/bloqade/core/device/local_storage.py
958 959 960 | |
get_program_language
get_program_language(task_id: str) -> str
Return the program language for a stored task definition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Stored program language. |
Raises:
| Type | Description |
|---|---|
KeyError | If |
Source code in src/bloqade/core/device/local_storage.py
1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 | |
get_programs
get_programs(
task_ids: tuple[str, ...] | None = None,
) -> list[dict]
Return stored program records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_ids | tuple[str, ...] | None | Optional task IDs to include. When None, programs for all stored tasks are returned. Defaults to None. | None |
Returns:
| Type | Description |
|---|---|
list[dict] | list[dict]: Program dictionaries ordered by task ID and program index. |
Source code in src/bloqade/core/device/local_storage.py
1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 | |
get_shots
get_shots(
*, shot_filter: ShotFilter | None = None
) -> Iterable[ShotResult]
Return SQLite shot rows matching a filter.
Other Parameters:
| Name | Type | Description |
|---|---|---|
shot_filter | ShotFilter | None | Optional shot filter. When None, all shots are returned. Defaults to None. |
Returns:
| Type | Description |
|---|---|
Iterable[ShotResult] | Iterable[ShotResult]: Matching shot rows. |
Source code in src/bloqade/core/device/local_storage.py
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 | |
get_subtasks
get_subtasks(
storage_filter: StorageFilter | None = None,
) -> list[dict]
Return stored subtask records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage_filter | StorageFilter | None | Optional metadata filter. When None, all subtasks are returned. Defaults to None. | None |
Returns:
| Type | Description |
|---|---|
list[dict] | list[dict]: Subtask dictionaries ordered by task ID and subtask index. |
Source code in src/bloqade/core/device/local_storage.py
1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 | |
get_task_creation_time
get_task_creation_time(task_id: str) -> datetime.datetime
Return the creation time for a stored task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
Returns:
| Type | Description |
|---|---|
datetime | datetime.datetime: Stored task creation time. |
Raises:
| Type | Description |
|---|---|
KeyError | If |
Source code in src/bloqade/core/device/local_storage.py
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 | |
get_task_group_id
get_task_group_id(task_id: str) -> UUID | None
Return the QLAM group stored for a task definition.
Source code in src/bloqade/core/device/local_storage.py
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 | |
task_ids
task_ids() -> set[str]
Return task IDs with stored task definitions.
Returns:
| Type | Description |
|---|---|
set[str] | set[str]: Stored task IDs. |
Source code in src/bloqade/core/device/local_storage.py
962 963 964 965 966 967 968 969 | |
update_subtasks_completed_date
update_subtasks_completed_date(
task_id, subtasks: list[dict]
) -> None
Update completion times for stored subtasks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
subtasks | list[dict] | API subtask dictionaries containing | required |
Source code in src/bloqade/core/device/local_storage.py
1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 | |
ShotFilter dataclass
ShotFilter(
task_ids: tuple[str, ...] | None = None,
subtask_indices: tuple[int, ...] | None = None,
task_subtask_pairs: (
tuple[tuple[str, int], ...] | None
) = None,
frame_type: str | None = None,
task_shot_pairs: (
tuple[tuple[str, int], ...] | None
) = None,
)
Bases: StorageFilter
flowchart TD
bloqade.core.device.local_storage.ShotFilter[ShotFilter]
bloqade.core.device.local_storage.StorageFilter[StorageFilter]
bloqade.core.device.local_storage.StorageFilter --> bloqade.core.device.local_storage.ShotFilter
click bloqade.core.device.local_storage.ShotFilter href "" "bloqade.core.device.local_storage.ShotFilter"
click bloqade.core.device.local_storage.StorageFilter href "" "bloqade.core.device.local_storage.StorageFilter"
Filter for shot result rows.
Extends StorageFilter with frame-type and shot-pair criteria. frame_type is normalized to uppercase during initialization.
Attributes:
| Name | Type | Description |
|---|---|---|
frame_type | str | None | Frame type to include. Defaults to None. |
task_shot_pairs | tuple[tuple[str, int], ...] | None | Exact |
ShotResult dataclass
ShotResult(
task_id: str,
shot_index: int,
subtask_index: int,
subtask_shot_index: int,
frame_type: str,
bitstring: ndarray,
)
Stored result for one shot and frame type.
Attributes:
| Name | Type | Description |
|---|---|---|
task_id | str | Backend task ID that produced the shot. |
shot_index | int | Shot index within the task. |
subtask_index | int | Subtask index within the task definition. |
subtask_shot_index | int | Shot index local to the subtask. |
frame_type | str | Result frame type, such as "DETECTED". |
bitstring | ndarray | Boolean measurement bitstring. |
StorageBackend
Bases: ABC
flowchart TD
bloqade.core.device.local_storage.StorageBackend[StorageBackend]
click bloqade.core.device.local_storage.StorageBackend href "" "bloqade.core.device.local_storage.StorageBackend"
Abstract storage backend for shot results.
Implementations store shot rows together with enough task metadata to reconstruct TaskDefinition objects and create Result views.
NOTE: methods that return mutable dictionaries should return independent copies. Result helpers may mutate returned metadata records while building merged views.
add_shots abstractmethod
add_shots(shots: Iterable[ShotResult]) -> None
Store shot result rows.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shots | Iterable[ShotResult] | Shot rows to store. | required |
Source code in src/bloqade/core/device/local_storage.py
101 102 103 104 105 106 107 108 | |
add_task_definition abstractmethod
add_task_definition(
task_id: str,
task_definition: TaskDefinition,
creation_time: datetime,
)
Store a task definition and its creation time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
task_definition | TaskDefinition | Task definition to store. | required |
creation_time | datetime | Backend task creation time. | required |
Source code in src/bloqade/core/device/local_storage.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
filter_by_arguments
filter_by_arguments(
predicate: Callable[[dict | None], bool],
storage_filter: StorageFilter | None = None,
) -> StorageFilter
Build a filter from subtask arguments matching a predicate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predicate | Callable[[dict | None], bool] | Predicate applied to each selected subtask's arguments. | required |
storage_filter | StorageFilter | None | Optional filter used before evaluating the predicate. Defaults to None. | None |
Returns:
| Name | Type | Description |
|---|---|---|
StorageFilter | StorageFilter | Filter containing matching |
Source code in src/bloqade/core/device/local_storage.py
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | |
filter_by_metadata
filter_by_metadata(
predicate: Callable[[dict | None], bool],
storage_filter: StorageFilter | None = None,
) -> StorageFilter
Build a filter from JSON-decoded user metadata.
This expects metadata to have been set as a dictionary and serialized as JSON. If metadata cannot be deserialized by JSON, fetch and filter the subtasks manually.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predicate | Callable[[dict | None], bool] | Predicate applied to each selected subtask's decoded | required |
storage_filter | StorageFilter | None | Optional filter used before evaluating the predicate. Defaults to None. | None |
Returns:
| Name | Type | Description |
|---|---|---|
StorageFilter | StorageFilter | Filter containing matching |
Source code in src/bloqade/core/device/local_storage.py
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | |
filter_by_shots
filter_by_shots(
predicate: Callable[[ShotResult], bool],
shot_filter: ShotFilter | None = None,
) -> ShotFilter
Build a filter from shots matching a predicate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predicate | Callable[[ShotResult], bool] | Predicate applied to each selected shot. | required |
shot_filter | ShotFilter | None | Optional filter used before evaluating the predicate. Defaults to None. | None |
Returns:
| Name | Type | Description |
|---|---|---|
ShotFilter | ShotFilter | Filter containing matching |
Source code in src/bloqade/core/device/local_storage.py
401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 | |
filter_by_subtasks
filter_by_subtasks(
predicate: Callable[[dict], bool],
storage_filter: StorageFilter | None = None,
) -> StorageFilter
Build a filter from subtasks matching a predicate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predicate | Callable[[dict], bool] | Predicate applied to each selected subtask dictionary. | required |
storage_filter | StorageFilter | None | Optional filter used before evaluating the predicate. Defaults to None. | None |
Returns:
| Name | Type | Description |
|---|---|---|
StorageFilter | StorageFilter | Filter containing matching |
Source code in src/bloqade/core/device/local_storage.py
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
get_arguments
get_arguments(
storage_filter: StorageFilter | None = None,
) -> list[dict | None]
Return arguments from stored subtasks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage_filter | StorageFilter | None | Optional subtask metadata filter. Defaults to None. | None |
Returns:
| Type | Description |
|---|---|
list[dict | None] | list[dict | None]: Arguments from matching subtasks. |
Source code in src/bloqade/core/device/local_storage.py
284 285 286 287 288 289 290 291 292 293 294 295 296 297 | |
get_program_language abstractmethod
get_program_language(task_id: str) -> str
Return the program language for a stored task definition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
Returns:
| Name | Type | Description |
|---|---|---|
str | str | Program language stored for the task. |
Raises:
| Type | Description |
|---|---|
KeyError | If |
Source code in src/bloqade/core/device/local_storage.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
get_programs abstractmethod
get_programs(
task_ids: tuple[str, ...] | None = None,
) -> list[dict]
Return stored program records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_ids | tuple[str, ...] | None | Optional task IDs to include. When None, programs for all stored task IDs are returned. Defaults to None. | None |
Returns:
| Type | Description |
|---|---|
list[dict] | list[dict]: Program dictionaries with |
Source code in src/bloqade/core/device/local_storage.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
get_shots abstractmethod
get_shots(
*, shot_filter: ShotFilter | None = None
) -> Iterable[ShotResult]
Return stored shot rows matching a filter.
Other Parameters:
| Name | Type | Description |
|---|---|---|
shot_filter | ShotFilter | None | Optional shot filter. When None, all shots are returned. Defaults to None. |
Returns:
| Type | Description |
|---|---|
Iterable[ShotResult] | Iterable[ShotResult]: Matching shot rows. |
Source code in src/bloqade/core/device/local_storage.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
get_subtasks abstractmethod
get_subtasks(
storage_filter: StorageFilter | None = None,
) -> list[dict]
Return stored subtask records.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
storage_filter | StorageFilter | None | Optional subtask metadata filter. When None, all subtasks are returned. Defaults to None. | None |
Returns:
| Type | Description |
|---|---|
list[dict] | list[dict]: Subtask dictionaries, including task ID, subtask index, program index, shot count, arguments, metadata, and completion date. |
Source code in src/bloqade/core/device/local_storage.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 | |
get_task_creation_time abstractmethod
get_task_creation_time(task_id: str) -> datetime.datetime
Return the creation time for a stored task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
Returns:
| Type | Description |
|---|---|
datetime | datetime.datetime: Stored task creation time. |
Raises:
| Type | Description |
|---|---|
KeyError | If |
Source code in src/bloqade/core/device/local_storage.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
get_task_definition
get_task_definition(task_id: str) -> TaskDefinition
Reconstruct a task definition from stored metadata.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
Returns:
| Name | Type | Description |
|---|---|---|
TaskDefinition | TaskDefinition | Reconstructed task definition. |
Source code in src/bloqade/core/device/local_storage.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
get_task_group_id
get_task_group_id(task_id: str) -> UUID | None
Return the QLAM group associated with a stored task definition.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
Returns:
| Type | Description |
|---|---|
UUID | None | UUID | None: Stored group UUID, or None when the task definition |
UUID | None | did not specify a group. |
The default keeps existing custom storage backends compatible; those backends simply reconstruct definitions without an explicit group. Built-in storage backends override this to preserve the group UUID.
Source code in src/bloqade/core/device/local_storage.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
task_ids abstractmethod
task_ids() -> set[str]
Return task IDs with stored task definitions.
Returns:
| Type | Description |
|---|---|
set[str] | set[str]: Stored task IDs. |
Source code in src/bloqade/core/device/local_storage.py
127 128 129 130 131 132 133 134 | |
update_subtasks_completed_date abstractmethod
update_subtasks_completed_date(
task_id, subtasks: list[dict]
) -> None
Update completion times for stored subtasks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task_id | str | Backend task ID. | required |
subtasks | list[dict] | API subtask dictionaries containing | required |
Source code in src/bloqade/core/device/local_storage.py
228 229 230 231 232 233 234 235 236 237 238 | |
StorageFilter dataclass
StorageFilter(
task_ids: tuple[str, ...] | None = None,
subtask_indices: tuple[int, ...] | None = None,
task_subtask_pairs: (
tuple[tuple[str, int], ...] | None
) = None,
)
Filter for task and subtask metadata rows.
All separate filters are AND-ed. Use task_subtask_pairs to specify exact pairs rather than combining task_ids and subtask_indices independently.
Attributes:
| Name | Type | Description |
|---|---|---|
task_ids | tuple[str, ...] | None | Task IDs to include. Defaults to None. |
subtask_indices | tuple[int, ...] | None | Subtask indices to include. Defaults to None. |
task_subtask_pairs | tuple[tuple[str, int], ...] | None | Exact |
task_subtask_pairs class-attribute instance-attribute
task_subtask_pairs: tuple[tuple[str, int], ...] | None = (
None
)
Exact pairs to use instead of separate task and subtask filters.