QuLab 2.4.16__cp311-cp311-macosx_10_9_universal2.whl → 2.4.18__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.16.dist-info → QuLab-2.4.18.dist-info}/METADATA +1 -1
- {QuLab-2.4.16.dist-info → QuLab-2.4.18.dist-info}/RECORD +12 -12
- qulab/executor/cli.py +15 -5
- qulab/executor/load.py +6 -2
- qulab/executor/schedule.py +13 -5
- qulab/executor/utils.py +2 -2
- qulab/fun.cpython-311-darwin.so +0 -0
- qulab/version.py +1 -1
- {QuLab-2.4.16.dist-info → QuLab-2.4.18.dist-info}/LICENSE +0 -0
- {QuLab-2.4.16.dist-info → QuLab-2.4.18.dist-info}/WHEEL +0 -0
- {QuLab-2.4.16.dist-info → QuLab-2.4.18.dist-info}/entry_points.txt +0 -0
- {QuLab-2.4.16.dist-info → QuLab-2.4.18.dist-info}/top_level.txt +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
qulab/__init__.py,sha256=P-Mx2p4TVmL91SoxoeXcj8Qm0x4xUf5Q_FLk0Yc_gIQ,138
|
|
2
2
|
qulab/__main__.py,sha256=JgErYkiskih8Y6oRwowALtR-rwQhAAdqOYWjQraRIPI,59
|
|
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=jPG-O3zEKS-xcQrACZN9B5p5szRn1MaMFJh2W1BFDSM,126848
|
|
5
|
+
qulab/version.py,sha256=vQo2edKgYGHn5FfacX8TS2Blt-3b9unuA9CvJvhZhfo,22
|
|
6
6
|
qulab/cli/__init__.py,sha256=tgDIkkeIoasQXAifJZ6NU8jDgpNgb2a-B0C4nF0evrE,559
|
|
7
7
|
qulab/cli/config.py,sha256=QksTYD3-RBYBG8xnKLAh7EXrNOwxr128XXr30ZTFW6A,2983
|
|
8
8
|
qulab/executor/__init__.py,sha256=LosPzOMaljSZY1thy_Fxtbrgq7uubJszMABEB7oM7tU,101
|
|
9
|
-
qulab/executor/cli.py,sha256=
|
|
10
|
-
qulab/executor/load.py,sha256=
|
|
11
|
-
qulab/executor/schedule.py,sha256=
|
|
9
|
+
qulab/executor/cli.py,sha256=owdDSaSuzTPQA5SlNCxX4nHWITU1BF0VZMj7tLqCZhM,5781
|
|
10
|
+
qulab/executor/load.py,sha256=eKysHL5EHKd_YcfHOVwRoaNsD-k0cTuxDY_7Yn5W8hA,11078
|
|
11
|
+
qulab/executor/schedule.py,sha256=bXQzn3e3tCvAVdEBsvh5ecAThP52njyxbsrlrxC9TzA,11922
|
|
12
12
|
qulab/executor/storage.py,sha256=M66Q5_Uc5MMfc_QAuuaaexwAz7wxBPMkeleB5nRpQmI,4621
|
|
13
13
|
qulab/executor/transform.py,sha256=inaOn6eqCs22ZZ0xAQl8s8YCoEACaXSwFNNu7jqdwAk,2148
|
|
14
|
-
qulab/executor/utils.py,sha256=
|
|
14
|
+
qulab/executor/utils.py,sha256=RmnT0wMTAvavM-abgFt2tQN8TaaHuk86-YAiOUQCoBU,3101
|
|
15
15
|
qulab/monitor/__init__.py,sha256=nTHelnDpxRS_fl_B38TsN0njgq8eVTEz9IAnN3NbDlM,42
|
|
16
16
|
qulab/monitor/__main__.py,sha256=w3yUcqq195LzSnXTkQcuC1RSFRhy4oQ_PEBmucXguME,97
|
|
17
17
|
qulab/monitor/config.py,sha256=fQ5JcsMApKc1UwANEnIvbDQZl8uYW0tle92SaYtX9lI,744
|
|
@@ -91,9 +91,9 @@ qulab/visualization/plot_seq.py,sha256=UWTS6p9nfX_7B8ehcYo6UnSTUCjkBsNU9jiOeW2ca
|
|
|
91
91
|
qulab/visualization/qdat.py,sha256=ZeevBYWkzbww4xZnsjHhw7wRorJCBzbG0iEu-XQB4EA,5735
|
|
92
92
|
qulab/visualization/rot3d.py,sha256=lMrEJlRLwYe6NMBlGkKYpp_V9CTipOAuDy6QW_cQK00,734
|
|
93
93
|
qulab/visualization/widgets.py,sha256=6KkiTyQ8J-ei70LbPQZAK35wjktY47w2IveOa682ftA,3180
|
|
94
|
-
QuLab-2.4.
|
|
95
|
-
QuLab-2.4.
|
|
96
|
-
QuLab-2.4.
|
|
97
|
-
QuLab-2.4.
|
|
98
|
-
QuLab-2.4.
|
|
99
|
-
QuLab-2.4.
|
|
94
|
+
QuLab-2.4.18.dist-info/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
|
|
95
|
+
QuLab-2.4.18.dist-info/METADATA,sha256=SX3AKzWxSqBxr-pLe9B0pVY65i7zCPltEgIkq-yKVWU,3699
|
|
96
|
+
QuLab-2.4.18.dist-info/WHEEL,sha256=K10eKSN6_vzvMOgXxWbVOQNR7Orfl6gBTCpCI8bcYx4,114
|
|
97
|
+
QuLab-2.4.18.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
|
|
98
|
+
QuLab-2.4.18.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
|
|
99
|
+
QuLab-2.4.18.dist-info/RECORD,,
|
qulab/executor/cli.py
CHANGED
|
@@ -54,6 +54,7 @@ def create(workflow, code):
|
|
|
54
54
|
"""
|
|
55
55
|
Create a new workflow file.
|
|
56
56
|
"""
|
|
57
|
+
logger.info(f'[CMD]: create {workflow} --code {code}')
|
|
57
58
|
if code is None:
|
|
58
59
|
code = Path.cwd()
|
|
59
60
|
|
|
@@ -82,6 +83,7 @@ def set(key, value, api):
|
|
|
82
83
|
"""
|
|
83
84
|
Set a config.
|
|
84
85
|
"""
|
|
86
|
+
logger.info(f'[CMD]: set {key} {value} --api {api}')
|
|
85
87
|
from . import transform
|
|
86
88
|
if api is not None:
|
|
87
89
|
api = importlib.import_module(api)
|
|
@@ -103,6 +105,7 @@ def get(key, api):
|
|
|
103
105
|
"""
|
|
104
106
|
Get a config.
|
|
105
107
|
"""
|
|
108
|
+
logger.info(f'[CMD]: get {key} --api {api}')
|
|
106
109
|
from . import transform
|
|
107
110
|
if api is not None:
|
|
108
111
|
api = importlib.import_module(api)
|
|
@@ -117,12 +120,16 @@ def get(key, api):
|
|
|
117
120
|
'-n',
|
|
118
121
|
is_flag=True,
|
|
119
122
|
help='Do not run dependents.')
|
|
123
|
+
@click.option('--update', '-u', is_flag=True)
|
|
120
124
|
@log_options
|
|
121
125
|
@command_option('run')
|
|
122
|
-
def run(workflow, code, data, api, plot, no_dependents):
|
|
126
|
+
def run(workflow, code, data, api, plot, no_dependents, update):
|
|
123
127
|
"""
|
|
124
128
|
Run a workflow.
|
|
125
129
|
"""
|
|
130
|
+
logger.info(
|
|
131
|
+
f'[CMD]: run {workflow} --code {code} --data {data} --api {api}{" --plot" if plot else ""}{" --no-dependents" if no_dependents else ""}{" --update " if update else ""}'
|
|
132
|
+
)
|
|
126
133
|
if api is not None:
|
|
127
134
|
api = importlib.import_module(api)
|
|
128
135
|
set_config_api(api.query_config, api.update_config)
|
|
@@ -139,15 +146,15 @@ def run(workflow, code, data, api, plot, no_dependents):
|
|
|
139
146
|
if no_dependents:
|
|
140
147
|
if hasattr(wf, 'entries'):
|
|
141
148
|
for entry in get_entries(wf, code):
|
|
142
|
-
run_workflow(entry, code, data, plot=plot)
|
|
149
|
+
run_workflow(entry, code, data, plot=plot, update=update)
|
|
143
150
|
else:
|
|
144
|
-
run_workflow(wf, code, data, plot=plot)
|
|
151
|
+
run_workflow(wf, code, data, plot=plot, update=update)
|
|
145
152
|
else:
|
|
146
153
|
if hasattr(wf, 'entries'):
|
|
147
154
|
for entry in get_entries(wf, code):
|
|
148
|
-
maintain_workflow(entry, code, data, run=True, plot=plot)
|
|
155
|
+
maintain_workflow(entry, code, data, run=True, plot=plot, update=update)
|
|
149
156
|
else:
|
|
150
|
-
maintain_workflow(wf, code, data, run=True, plot=plot)
|
|
157
|
+
maintain_workflow(wf, code, data, run=True, plot=plot, update=update)
|
|
151
158
|
|
|
152
159
|
|
|
153
160
|
@click.command()
|
|
@@ -159,6 +166,9 @@ def maintain(workflow, code, data, api, plot):
|
|
|
159
166
|
"""
|
|
160
167
|
Maintain a workflow.
|
|
161
168
|
"""
|
|
169
|
+
logger.info(
|
|
170
|
+
f'[CMD]: maintain {workflow} --code {code} --data {data} --api {api}{" --plot" if plot else ""}'
|
|
171
|
+
)
|
|
162
172
|
if api is not None:
|
|
163
173
|
api = importlib.import_module(api)
|
|
164
174
|
set_config_api(api.query_config, api.update_config)
|
qulab/executor/load.py
CHANGED
|
@@ -21,7 +21,7 @@ class SetConfigWorkflow():
|
|
|
21
21
|
self.key = key
|
|
22
22
|
|
|
23
23
|
def depends(self):
|
|
24
|
-
return [
|
|
24
|
+
return []
|
|
25
25
|
|
|
26
26
|
def check_state(self, history: Result) -> bool:
|
|
27
27
|
from . import transform
|
|
@@ -254,6 +254,10 @@ def load_workflow_from_template(template_path: str,
|
|
|
254
254
|
return new_text
|
|
255
255
|
|
|
256
256
|
template = string.Template(replace(content))
|
|
257
|
+
keys = template.get_identifiers()
|
|
258
|
+
missing = set(keys) - set(mappping.keys())
|
|
259
|
+
if missing:
|
|
260
|
+
raise KeyError(f"{template_path}: Missing keys in mapping: {missing}")
|
|
257
261
|
content = template.substitute(mappping)
|
|
258
262
|
|
|
259
263
|
hash_str = hashlib.md5(pickle.dumps(mappping)).hexdigest()[:8]
|
|
@@ -323,7 +327,7 @@ def get_dependents(workflow: WorkflowType,
|
|
|
323
327
|
code_path: str | Path) -> list[WorkflowType]:
|
|
324
328
|
return [
|
|
325
329
|
load_workflow(n, code_path, mtime=workflow.__mtime__)
|
|
326
|
-
for n in workflow.depends()
|
|
330
|
+
for n in workflow.depends()
|
|
327
331
|
]
|
|
328
332
|
|
|
329
333
|
|
qulab/executor/schedule.py
CHANGED
|
@@ -236,7 +236,8 @@ def maintain(workflow: WorkflowType,
|
|
|
236
236
|
state_path: str | Path,
|
|
237
237
|
session_id: str | None = None,
|
|
238
238
|
run: bool = False,
|
|
239
|
-
plot: bool = False
|
|
239
|
+
plot: bool = False,
|
|
240
|
+
update: bool = True):
|
|
240
241
|
if session_id is None:
|
|
241
242
|
session_id = uuid.uuid4().hex
|
|
242
243
|
logger.debug(f'run "{workflow.__workflow_id__}"'
|
|
@@ -280,7 +281,8 @@ def maintain(workflow: WorkflowType,
|
|
|
280
281
|
raise CalibrationFailedError(
|
|
281
282
|
f'"{workflow.__workflow_id__}": All dependents passed, but calibration failed!'
|
|
282
283
|
)
|
|
283
|
-
|
|
284
|
+
if update:
|
|
285
|
+
transform.update_parameters(result)
|
|
284
286
|
return
|
|
285
287
|
|
|
286
288
|
|
|
@@ -288,13 +290,19 @@ def maintain(workflow: WorkflowType,
|
|
|
288
290
|
def run(workflow: WorkflowType,
|
|
289
291
|
code_path: str | Path,
|
|
290
292
|
state_path: str | Path,
|
|
291
|
-
plot: bool = False
|
|
293
|
+
plot: bool = False,
|
|
294
|
+
update: bool = True):
|
|
292
295
|
session_id = uuid.uuid4().hex
|
|
293
296
|
logger.debug(f'run "{workflow.__workflow_id__}" without dependences.')
|
|
294
|
-
result = calibrate(workflow,
|
|
297
|
+
result = calibrate(workflow,
|
|
298
|
+
code_path,
|
|
299
|
+
state_path,
|
|
300
|
+
plot,
|
|
301
|
+
session_id=session_id)
|
|
295
302
|
if result.bad_data or not result.in_spec:
|
|
296
303
|
raise CalibrationFailedError(
|
|
297
304
|
f'"{workflow.__workflow_id__}": All dependents passed, but calibration failed!'
|
|
298
305
|
)
|
|
299
|
-
|
|
306
|
+
if update:
|
|
307
|
+
transform.update_parameters(result)
|
|
300
308
|
return
|
qulab/executor/utils.py
CHANGED
|
@@ -25,7 +25,7 @@ def dependent_tree(node: str, code_path: str | Path) -> dict[str, list[str]]:
|
|
|
25
25
|
Returns a dict of nodes and their dependents.
|
|
26
26
|
'''
|
|
27
27
|
tree = {}
|
|
28
|
-
for n in load_workflow(node, code_path).depends()
|
|
28
|
+
for n in load_workflow(node, code_path).depends():
|
|
29
29
|
tree[n] = dependent_tree(n, code_path)
|
|
30
30
|
return tree
|
|
31
31
|
|
|
@@ -43,7 +43,7 @@ import numpy as np
|
|
|
43
43
|
__timeout__ = 7*24*3600
|
|
44
44
|
|
|
45
45
|
def depends():
|
|
46
|
-
return
|
|
46
|
+
return {deps!r}
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
def calibrate():
|
qulab/fun.cpython-311-darwin.so
CHANGED
|
Binary file
|
qulab/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.4.
|
|
1
|
+
__version__ = "2.4.18"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|