QuLab 2.4.4__cp311-cp311-macosx_10_9_universal2.whl → 2.4.6__cp311-cp311-macosx_10_9_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {QuLab-2.4.4.dist-info → QuLab-2.4.6.dist-info}/METADATA +1 -1
- {QuLab-2.4.4.dist-info → QuLab-2.4.6.dist-info}/RECORD +11 -11
- qulab/executor/__main__.py +11 -8
- qulab/executor/schedule.py +32 -22
- qulab/executor/utils.py +1 -1
- qulab/fun.cpython-311-darwin.so +0 -0
- qulab/version.py +1 -1
- {QuLab-2.4.4.dist-info → QuLab-2.4.6.dist-info}/LICENSE +0 -0
- {QuLab-2.4.4.dist-info → QuLab-2.4.6.dist-info}/WHEEL +0 -0
- {QuLab-2.4.4.dist-info → QuLab-2.4.6.dist-info}/entry_points.txt +0 -0
- {QuLab-2.4.4.dist-info → QuLab-2.4.6.dist-info}/top_level.txt +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
qulab/__init__.py,sha256=P-Mx2p4TVmL91SoxoeXcj8Qm0x4xUf5Q_FLk0Yc_gIQ,138
|
|
2
2
|
qulab/__main__.py,sha256=V5jIyfuCSi5dI6jvqgH_BpXG0URd6bgneDdVCM1dGSA,545
|
|
3
3
|
qulab/dicttree.py,sha256=tRRMpGZYVOLw0TEByE3_2Ss8FdOmzuGL9e1DWbs8qoY,13684
|
|
4
|
-
qulab/fun.cpython-311-darwin.so,sha256=
|
|
5
|
-
qulab/version.py,sha256=
|
|
4
|
+
qulab/fun.cpython-311-darwin.so,sha256=lv3X6rjswckPxJ8ztPehlluwseqcgsDOPOEh3yrGFJY,126848
|
|
5
|
+
qulab/version.py,sha256=jzWsJzFuYAnC9Fllul1PYEIxXD-Lspqc6-IMg65EXLc,21
|
|
6
6
|
qulab/executor/__init__.py,sha256=LosPzOMaljSZY1thy_Fxtbrgq7uubJszMABEB7oM7tU,101
|
|
7
|
-
qulab/executor/__main__.py,sha256=
|
|
7
|
+
qulab/executor/__main__.py,sha256=1Mg5fJ0dYSWQnP6wgTa0s6U_WH7NT2lCnCQOHyx_I7c,2430
|
|
8
8
|
qulab/executor/load.py,sha256=jZHkEzFF8ufFAIajkRDKmHYYJxbxI3RcEbAFIbl9VQ0,6208
|
|
9
|
-
qulab/executor/schedule.py,sha256
|
|
9
|
+
qulab/executor/schedule.py,sha256=blxX1wYEjbJcV6Su3ftQma8fGoMMQ_1t276PPoDjhfU,9524
|
|
10
10
|
qulab/executor/storage.py,sha256=M66Q5_Uc5MMfc_QAuuaaexwAz7wxBPMkeleB5nRpQmI,4621
|
|
11
11
|
qulab/executor/transform.py,sha256=inaOn6eqCs22ZZ0xAQl8s8YCoEACaXSwFNNu7jqdwAk,2148
|
|
12
|
-
qulab/executor/utils.py,sha256=
|
|
12
|
+
qulab/executor/utils.py,sha256=n3uCSKh-qdDFFeNvOpj7_es2_B4AaC-ASAlV9gPmSO0,3086
|
|
13
13
|
qulab/monitor/__init__.py,sha256=nTHelnDpxRS_fl_B38TsN0njgq8eVTEz9IAnN3NbDlM,42
|
|
14
14
|
qulab/monitor/__main__.py,sha256=w3yUcqq195LzSnXTkQcuC1RSFRhy4oQ_PEBmucXguME,97
|
|
15
15
|
qulab/monitor/config.py,sha256=fQ5JcsMApKc1UwANEnIvbDQZl8uYW0tle92SaYtX9lI,744
|
|
@@ -89,9 +89,9 @@ qulab/visualization/plot_seq.py,sha256=UWTS6p9nfX_7B8ehcYo6UnSTUCjkBsNU9jiOeW2ca
|
|
|
89
89
|
qulab/visualization/qdat.py,sha256=ZeevBYWkzbww4xZnsjHhw7wRorJCBzbG0iEu-XQB4EA,5735
|
|
90
90
|
qulab/visualization/rot3d.py,sha256=lMrEJlRLwYe6NMBlGkKYpp_V9CTipOAuDy6QW_cQK00,734
|
|
91
91
|
qulab/visualization/widgets.py,sha256=6KkiTyQ8J-ei70LbPQZAK35wjktY47w2IveOa682ftA,3180
|
|
92
|
-
QuLab-2.4.
|
|
93
|
-
QuLab-2.4.
|
|
94
|
-
QuLab-2.4.
|
|
95
|
-
QuLab-2.4.
|
|
96
|
-
QuLab-2.4.
|
|
97
|
-
QuLab-2.4.
|
|
92
|
+
QuLab-2.4.6.dist-info/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
|
|
93
|
+
QuLab-2.4.6.dist-info/METADATA,sha256=xcG5D2k2LSHdq1VqLFx2isvhwkmWO-j72g0wyl2rLKY,3698
|
|
94
|
+
QuLab-2.4.6.dist-info/WHEEL,sha256=K10eKSN6_vzvMOgXxWbVOQNR7Orfl6gBTCpCI8bcYx4,114
|
|
95
|
+
QuLab-2.4.6.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
|
|
96
|
+
QuLab-2.4.6.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
|
|
97
|
+
QuLab-2.4.6.dist-info/RECORD,,
|
qulab/executor/__main__.py
CHANGED
|
@@ -4,7 +4,8 @@ from pathlib import Path
|
|
|
4
4
|
import click
|
|
5
5
|
|
|
6
6
|
from .load import find_unreferenced_workflows
|
|
7
|
-
from .schedule import maintain as maintain_workflow
|
|
7
|
+
from .schedule import maintain as maintain_workflow
|
|
8
|
+
from .schedule import run as run_workflow
|
|
8
9
|
from .transform import set_config_api
|
|
9
10
|
from .utils import workflow_template
|
|
10
11
|
|
|
@@ -41,9 +42,10 @@ def create(workflow, code):
|
|
|
41
42
|
@click.argument('workflow')
|
|
42
43
|
@click.option('--code', '-c', default=None)
|
|
43
44
|
@click.option('--data', '-d', default=None)
|
|
44
|
-
@click.option('--api', '-
|
|
45
|
+
@click.option('--api', '-a', default=None)
|
|
46
|
+
@click.option('--plot', '-p', is_flag=True)
|
|
45
47
|
@click.option('--no-dependents', '-n', is_flag=True)
|
|
46
|
-
def run(workflow, code, data, api, no_dependents):
|
|
48
|
+
def run(workflow, code, data, api, plot, no_dependents):
|
|
47
49
|
"""
|
|
48
50
|
Run a workflow.
|
|
49
51
|
"""
|
|
@@ -56,17 +58,18 @@ def run(workflow, code, data, api, no_dependents):
|
|
|
56
58
|
data = Path(code) / 'logs'
|
|
57
59
|
|
|
58
60
|
if no_dependents:
|
|
59
|
-
run_workflow(workflow, code, data)
|
|
61
|
+
run_workflow(workflow, code, data, plot=plot)
|
|
60
62
|
else:
|
|
61
|
-
maintain_workflow(workflow, code, data, run=True)
|
|
63
|
+
maintain_workflow(workflow, code, data, run=True, plot=plot)
|
|
62
64
|
|
|
63
65
|
|
|
64
66
|
@click.command()
|
|
65
67
|
@click.argument('workflow')
|
|
66
68
|
@click.option('--code', '-c', default=None)
|
|
67
69
|
@click.option('--data', '-d', default=None)
|
|
68
|
-
@click.option('--api', '-
|
|
69
|
-
|
|
70
|
+
@click.option('--api', '-a', default=None)
|
|
71
|
+
@click.option('--plot', '-p', is_flag=True)
|
|
72
|
+
def maintain(workflow, code, data, api, plot):
|
|
70
73
|
"""
|
|
71
74
|
Maintain a workflow.
|
|
72
75
|
"""
|
|
@@ -78,7 +81,7 @@ def maintain(workflow, code, data, api):
|
|
|
78
81
|
if data is None:
|
|
79
82
|
data = Path(code) / 'logs'
|
|
80
83
|
|
|
81
|
-
maintain_workflow(workflow, code, data, run=False)
|
|
84
|
+
maintain_workflow(workflow, code, data, run=False, plot=plot)
|
|
82
85
|
|
|
83
86
|
|
|
84
87
|
cli.add_command(maintain)
|
qulab/executor/schedule.py
CHANGED
|
@@ -59,7 +59,7 @@ def check_state(workflow: str, code_path: str | Path,
|
|
|
59
59
|
return True
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
def call_analyzer(node, data, history, check=False):
|
|
62
|
+
def call_analyzer(node, data, history, check=False, plot=False):
|
|
63
63
|
if check:
|
|
64
64
|
result = transform.params_to_result(
|
|
65
65
|
node.check_analyze(*data,
|
|
@@ -69,13 +69,21 @@ def call_analyzer(node, data, history, check=False):
|
|
|
69
69
|
result = transform.params_to_result(
|
|
70
70
|
node.analyze(*data, history=transform.result_to_params(history)))
|
|
71
71
|
result.fully_calibrated = True
|
|
72
|
+
if plot:
|
|
73
|
+
call_plot(node, result)
|
|
72
74
|
result.data = data
|
|
73
75
|
return result
|
|
74
76
|
|
|
75
77
|
|
|
78
|
+
def call_plot(node, result, check=False):
|
|
79
|
+
if hasattr(node, 'plot') and callable(node.plot):
|
|
80
|
+
state, params, other = transform.result_to_params(result)
|
|
81
|
+
node.plot(state, params, other)
|
|
82
|
+
|
|
83
|
+
|
|
76
84
|
@functools.lru_cache(maxsize=128)
|
|
77
85
|
def check_data(workflow: str, code_path: str | Path, state_path: str | Path,
|
|
78
|
-
session_id: str) -> Result:
|
|
86
|
+
plot: bool, session_id: str) -> Result:
|
|
79
87
|
"""
|
|
80
88
|
check data answers two questions:
|
|
81
89
|
Is the parameter associated with this cal in spec,
|
|
@@ -109,7 +117,7 @@ def check_data(workflow: str, code_path: str | Path, state_path: str | Path,
|
|
|
109
117
|
save_result(workflow, result, state_path)
|
|
110
118
|
|
|
111
119
|
logger.debug(f'Checked "{workflow}" !')
|
|
112
|
-
result = call_analyzer(node, data, history, check=True)
|
|
120
|
+
result = call_analyzer(node, data, history, check=True, plot=plot)
|
|
113
121
|
if result.in_spec:
|
|
114
122
|
logger.debug(f'"{workflow}": checked in spec, renewing result')
|
|
115
123
|
renew_result(workflow, state_path)
|
|
@@ -124,7 +132,7 @@ def check_data(workflow: str, code_path: str | Path, state_path: str | Path,
|
|
|
124
132
|
save_result(workflow, result, state_path)
|
|
125
133
|
|
|
126
134
|
logger.debug(f'Calibrated "{workflow}" !')
|
|
127
|
-
result = call_analyzer(node, data, history, check=False)
|
|
135
|
+
result = call_analyzer(node, data, history, check=False, plot=plot)
|
|
128
136
|
save_result(workflow, result, state_path,
|
|
129
137
|
get_head(workflow, state_path))
|
|
130
138
|
|
|
@@ -133,7 +141,7 @@ def check_data(workflow: str, code_path: str | Path, state_path: str | Path,
|
|
|
133
141
|
|
|
134
142
|
@functools.lru_cache(maxsize=128)
|
|
135
143
|
def calibrate(workflow, code_path: str | Path, state_path: str | Path,
|
|
136
|
-
session_id: str) -> Result:
|
|
144
|
+
plot: bool, session_id: str) -> Result:
|
|
137
145
|
node = load_workflow(workflow, code_path)
|
|
138
146
|
history = find_result(workflow, state_path)
|
|
139
147
|
|
|
@@ -143,38 +151,36 @@ def calibrate(workflow, code_path: str | Path, state_path: str | Path,
|
|
|
143
151
|
result.data = data
|
|
144
152
|
save_result(workflow, result, state_path)
|
|
145
153
|
logger.debug(f'Calibrated "{workflow}" !')
|
|
146
|
-
result = call_analyzer(node, data, history, check=False)
|
|
154
|
+
result = call_analyzer(node, data, history, check=False, plot=plot)
|
|
147
155
|
save_result(workflow, result, state_path, get_head(workflow, state_path))
|
|
148
156
|
return result
|
|
149
157
|
|
|
150
158
|
|
|
151
|
-
def diagnose(node, code_path: str | Path, state_path: str | Path,
|
|
159
|
+
def diagnose(node, code_path: str | Path, state_path: str | Path, plot: bool,
|
|
152
160
|
session_id: str):
|
|
153
161
|
'''
|
|
154
162
|
Returns: True if node or dependent recalibrated.
|
|
155
163
|
'''
|
|
156
164
|
logger.debug(f'diagnose "{node}"')
|
|
157
165
|
# check_data
|
|
158
|
-
result = check_data(node, code_path, state_path, session_id)
|
|
166
|
+
result = check_data(node, code_path, state_path, plot, session_id)
|
|
159
167
|
# in spec case
|
|
160
168
|
if result.in_spec:
|
|
169
|
+
logger.debug(f'"{node}": Checked! In spec, no need to diagnose')
|
|
161
170
|
return False
|
|
162
171
|
# bad data case
|
|
163
172
|
recalibrated = []
|
|
164
173
|
if result.bad_data:
|
|
165
174
|
recalibrated = [
|
|
166
|
-
diagnose(n, code_path, state_path, session_id)
|
|
175
|
+
diagnose(n, code_path, state_path, plot, session_id)
|
|
167
176
|
for n in get_dependents(node, code_path)
|
|
168
177
|
]
|
|
169
|
-
if not any(recalibrated):
|
|
178
|
+
if not any(recalibrated) and recalibrated:
|
|
179
|
+
logger.debug(f'"{node}": no dependents recalibrated.')
|
|
170
180
|
return False
|
|
171
181
|
# calibrate
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
else:
|
|
175
|
-
logger.debug(
|
|
176
|
-
f'recalibrate "{node}" because some dependents recalibrated')
|
|
177
|
-
result = calibrate(node, code_path, state_path, session_id)
|
|
182
|
+
logger.debug(f'recalibrate "{node}" because some dependents recalibrated')
|
|
183
|
+
result = calibrate(node, code_path, state_path, plot, session_id)
|
|
178
184
|
if result.bad_data or not result.in_spec:
|
|
179
185
|
raise CalibrationFailedError(
|
|
180
186
|
f'"{node}": All dependents passed, but calibration failed!')
|
|
@@ -191,7 +197,8 @@ def maintain(node,
|
|
|
191
197
|
code_path: str | Path,
|
|
192
198
|
state_path: str | Path,
|
|
193
199
|
session_id: str | None = None,
|
|
194
|
-
run: bool = False
|
|
200
|
+
run: bool = False,
|
|
201
|
+
plot: bool = False):
|
|
195
202
|
if session_id is None:
|
|
196
203
|
session_id = uuid.uuid4().hex
|
|
197
204
|
logger.debug(f'run "{node}"' if run else f'maintain "{node}"')
|
|
@@ -206,7 +213,7 @@ def maintain(node,
|
|
|
206
213
|
logger.debug(f'"{node}": In spec, no need to maintain')
|
|
207
214
|
return
|
|
208
215
|
# check_data
|
|
209
|
-
result = check_data(node, code_path, state_path, session_id)
|
|
216
|
+
result = check_data(node, code_path, state_path, plot, session_id)
|
|
210
217
|
if result.in_spec:
|
|
211
218
|
if not run:
|
|
212
219
|
logger.debug(f'"{node}": In spec, no need to maintain')
|
|
@@ -215,12 +222,12 @@ def maintain(node,
|
|
|
215
222
|
logger.debug(f'"{node}": Bad data, diagnosing dependents')
|
|
216
223
|
for n in get_dependents(node, code_path):
|
|
217
224
|
logger.debug(f'diagnose "{n}" because of "{node}" bad data')
|
|
218
|
-
diagnose(n, code_path, state_path, session_id)
|
|
225
|
+
diagnose(n, code_path, state_path, plot, session_id)
|
|
219
226
|
else:
|
|
220
227
|
logger.debug(f'"{node}": All dependents diagnosed')
|
|
221
228
|
# calibrate
|
|
222
229
|
logger.debug(f'recalibrate "{node}"')
|
|
223
|
-
result = calibrate(node, code_path, state_path, session_id)
|
|
230
|
+
result = calibrate(node, code_path, state_path, plot, session_id)
|
|
224
231
|
if result.bad_data or not result.in_spec:
|
|
225
232
|
raise CalibrationFailedError(
|
|
226
233
|
f'"{node}": All dependents passed, but calibration failed!')
|
|
@@ -228,9 +235,12 @@ def maintain(node,
|
|
|
228
235
|
return
|
|
229
236
|
|
|
230
237
|
|
|
231
|
-
def run(node,
|
|
238
|
+
def run(node,
|
|
239
|
+
code_path: str | Path,
|
|
240
|
+
state_path: str | Path,
|
|
241
|
+
plot: bool = False):
|
|
232
242
|
logger.debug(f'run "{node}" without dependences.')
|
|
233
|
-
result = calibrate(node, code_path, state_path)
|
|
243
|
+
result = calibrate(node, code_path, state_path, plot)
|
|
234
244
|
if result.bad_data or not result.in_spec:
|
|
235
245
|
raise CalibrationFailedError(
|
|
236
246
|
f'"{node}": All dependents passed, but calibration failed!')
|
qulab/executor/utils.py
CHANGED
qulab/fun.cpython-311-darwin.so
CHANGED
|
Binary file
|
qulab/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.4.
|
|
1
|
+
__version__ = "2.4.6"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|