API documentation of utils
This module contains some functions that are especially helpful for deployment of the sqooler package.
main(storage_provider, backends, num_iter=0)
Function for processing jobs continuously.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
storage_provider |
StorageProvider
|
The storage provider that should be used. |
required |
backends |
dict[str, Spooler]
|
A dictionary of all the backends that should be updated. |
required |
num_iter |
int
|
The number of iterations that should be done. If 0, then the loop will run forever. |
0
|
Source code in src/sqooler/utils.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
run_json_circuit(json_dict, job_id, spooler)
A support function that executes the job. Should be only used for testing.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
json_dict |
dict
|
the job dict that will be treated |
required |
job_id |
str
|
the number of the job |
required |
spooler |
Spooler
|
the spooler that will be used |
required |
Returns:
Type | Description |
---|---|
dict
|
the results dict |
Source code in src/sqooler/utils.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
update_backends(storage_provider, backends)
Update the backends on the storage.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
storage_provider |
StorageProvider
|
The storage provider that should be used. |
required |
backends |
dict[str, Spooler]
|
A dictionary of all the backends that should be updated. |
required |
Source code in src/sqooler/utils.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|