QuLab 2.7.12__cp310-cp310-macosx_10_9_universal2.whl → 2.7.13__cp310-cp310-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.
@@ -1,4 +1,5 @@
1
1
  import functools
2
+ import inspect
2
3
  import pickle
3
4
  import uuid
4
5
  from datetime import datetime, timedelta
@@ -231,21 +232,7 @@ def call_analyzer(node: WorkflowType,
231
232
  if hasattr(node, 'oracle') and callable(node.oracle):
232
233
  logger.debug(
233
234
  f'"{node.__workflow_id__}" has oracle method, calling ...')
234
- try:
235
- report = node.oracle(report,
236
- history=history,
237
- system_state=get_heads(report.base_path))
238
- except Exception as e:
239
- logger.exception(e)
240
- report.oracle = {}
241
- if not isinstance(report, Report):
242
- raise TypeError(
243
- f'"{node.__workflow_id__}" : function "oracle" must return a Report object'
244
- )
245
- if not is_pickleable(report.oracle):
246
- raise TypeError(
247
- f'"{node.__workflow_id__}" : function "oracle" return not pickleable data'
248
- )
235
+ report = call_oracle(node, report, history)
249
236
  report.fully_calibrated = True
250
237
  save_report(node.__workflow_id__, report, state_path, overwrite=True)
251
238
  if plot:
@@ -253,6 +240,35 @@ def call_analyzer(node: WorkflowType,
253
240
  return report
254
241
 
255
242
 
243
+ def call_oracle(node: WorkflowType, report: Report, history: Report | None):
244
+ sig = inspect.signature(node.oracle)
245
+ try:
246
+ if 'history' in sig.parameters and 'system_state' in sig.parameters:
247
+ report = node.oracle(report,
248
+ history=history,
249
+ system_state=get_heads(report.base_path))
250
+ elif 'history' in sig.parameters:
251
+ report = node.oracle(report, history=history)
252
+ elif 'system_state' in sig.parameters:
253
+ report = node.oracle(report,
254
+ system_state=get_heads(report.base_path))
255
+ else:
256
+ report = node.oracle(report)
257
+ except Exception as e:
258
+ logger.exception(e)
259
+ report.oracle = {}
260
+ return report
261
+ if not isinstance(report, Report):
262
+ raise TypeError(
263
+ f'"{node.__workflow_id__}" : function "oracle" must return a Report object'
264
+ )
265
+ if not is_pickleable(report.oracle):
266
+ raise TypeError(
267
+ f'"{node.__workflow_id__}" : function "oracle" return not pickleable data'
268
+ )
269
+ return report
270
+
271
+
256
272
  def check_data(workflow: WorkflowType, state_path: str | Path, plot: bool,
257
273
  session_id: str) -> Report:
258
274
  """
Binary file
@@ -0,0 +1,39 @@
1
+ class _Missing():
2
+
3
+ def __repr__(self):
4
+ return "Missing"
5
+
6
+
7
+ Missing = _Missing()
8
+
9
+
10
+ def connect_trace(*mappings):
11
+ if not mappings:
12
+ return {}
13
+ result = {}
14
+ first_mapping = mappings[0]
15
+ for key in first_mapping:
16
+ current_value = key
17
+ trajectory = []
18
+ for mapping in mappings:
19
+ if current_value is Missing:
20
+ trajectory.append(Missing)
21
+ continue
22
+ if current_value in mapping:
23
+ next_value = mapping[current_value]
24
+ trajectory.append(next_value)
25
+ current_value = next_value
26
+ else:
27
+ trajectory.append(Missing)
28
+ current_value = Missing
29
+ result[key] = trajectory
30
+ return result
31
+
32
+
33
+ def connect(*mappings):
34
+ if not mappings:
35
+ return {}
36
+ return {
37
+ k: v[-1]
38
+ for k, v in connect_trace(*mappings).items() if v[-1] is not Missing
39
+ }
qulab/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.7.12"
1
+ __version__ = "2.7.13"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: QuLab
3
- Version: 2.7.12
3
+ Version: 2.7.13
4
4
  Summary: contral instruments and manage data
5
5
  Author-email: feihoo87 <feihoo87@gmail.com>
6
6
  Maintainer-email: feihoo87 <feihoo87@gmail.com>
@@ -1,17 +1,17 @@
1
1
  qulab/__init__.py,sha256=KJcUcZ5qXY6wlAoirzK_B-dgtDjsLmOE671v3gcXO_c,286
2
2
  qulab/__main__.py,sha256=fjaRSL_uUjNIzBGNgjlGswb9TJ2VD5qnkZHW3hItrD4,68
3
3
  qulab/dicttree.py,sha256=tRRMpGZYVOLw0TEByE3_2Ss8FdOmzuGL9e1DWbs8qoY,13684
4
- qulab/fun.cpython-310-darwin.so,sha256=q6n9jyXo1VGeyNH2HB0BVU1nuFcez-k-bmzJTdR8wF8,126864
4
+ qulab/fun.cpython-310-darwin.so,sha256=R-OBPkXPgRwsfaAJzlKb69ZWAc4A8Jh7F8YCWyM0RsM,126864
5
5
  qulab/typing.py,sha256=vg62sGqxuD9CI5677ejlzAmf2fVdAESZCQjAE_xSxPg,69
6
6
  qulab/utils.py,sha256=JIXMSmZU0uYfKG_tzawpK7vRNPRir_hJE8JlqkVLX2o,1260
7
- qulab/version.py,sha256=lU1Df-qhbluQkmwozAIUZOHD7dGWclt66rz4f2uhpqA,22
7
+ qulab/version.py,sha256=aT1ObWeGn4CAPTB2n1JwBZCtp9XDVJssGu0Z4ACIIQ4,22
8
8
  qulab/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  qulab/cli/commands.py,sha256=tgDIkkeIoasQXAifJZ6NU8jDgpNgb2a-B0C4nF0evrE,559
10
10
  qulab/cli/config.py,sha256=Ei7eSYnbwPPlluDnm8YmWONYiI4g7WtvlZGQdr1Z6vo,3688
11
11
  qulab/executor/__init__.py,sha256=LosPzOMaljSZY1thy_Fxtbrgq7uubJszMABEB7oM7tU,101
12
12
  qulab/executor/cli.py,sha256=gGka2M6xccfM8facsIJ2qZ1y2Yx8C4BRhc1JG6nK9mo,8932
13
13
  qulab/executor/load.py,sha256=4FY_SwumLDUewC265v4j_ZGGpfYOgH4c8PtglYcWpBw,18077
14
- qulab/executor/schedule.py,sha256=YmVD0NH2YouAjWHjky_0IVfYv23J9upYFOxy8gVfJqw,18454
14
+ qulab/executor/schedule.py,sha256=9pTOVWzKiDc7ip8iuB_47poJcYOvoBI9eQwTrDTA3p0,19044
15
15
  qulab/executor/storage.py,sha256=gI6g28BmKKEZ_Pl-hFwvpiOj3mF8Su-yjj3hfMXs1VY,11630
16
16
  qulab/executor/transform.py,sha256=4DyGXv1Iw36cCPqbqXlsn0Lw6gFjQpp_6Hcta50YQxU,2181
17
17
  qulab/executor/utils.py,sha256=cF6-2jlvlHyTjNHdxXKG04Fjfm3_3wfDQAF1G8DQphk,5686
@@ -85,6 +85,7 @@ qulab/sys/rpc/socket.py,sha256=e3R0gwOHpLEkSp7Tb43FMSDvqSG-pjrkskdISKQRseE,713
85
85
  qulab/sys/rpc/utils.py,sha256=6YGFOkY7o09lkA_I1FIP9_1Up3k2F1KOkftvu0_8lxo,594
86
86
  qulab/sys/rpc/worker.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
87
  qulab/sys/rpc/zmq_socket.py,sha256=2uc9MjCRUwWm6iPmi2VGnOYNf9yWFSUzEVYrx0jZvPU,8272
88
+ qulab/tools/__init__.py,sha256=o1t6UpJQPyj4mWY66axgQkgsqUzdkhEGBJo44x9U1iE,946
88
89
  qulab/visualization/__init__.py,sha256=26cuHt3QIJXUb3VaMxlJx3IQTOUVJFKlYBZr7WMP53M,6129
89
90
  qulab/visualization/__main__.py,sha256=9zKK3yZFy0leU40ou6BpRC1Fsetfc1gjjFzIZYIwP6Y,1639
90
91
  qulab/visualization/_autoplot.py,sha256=31B7pn1pK19abpQDGYBU9a_27cDL87LBpx9vKqlcYAo,14165
@@ -94,9 +95,9 @@ qulab/visualization/plot_seq.py,sha256=UWTS6p9nfX_7B8ehcYo6UnSTUCjkBsNU9jiOeW2ca
94
95
  qulab/visualization/qdat.py,sha256=ZeevBYWkzbww4xZnsjHhw7wRorJCBzbG0iEu-XQB4EA,5735
95
96
  qulab/visualization/rot3d.py,sha256=lMrEJlRLwYe6NMBlGkKYpp_V9CTipOAuDy6QW_cQK00,734
96
97
  qulab/visualization/widgets.py,sha256=6KkiTyQ8J-ei70LbPQZAK35wjktY47w2IveOa682ftA,3180
97
- QuLab-2.7.12.dist-info/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
98
- QuLab-2.7.12.dist-info/METADATA,sha256=XO2FY8TwAPQk7FAnVETtmCVj_II9n12tnTeOD1oR7lI,3699
99
- QuLab-2.7.12.dist-info/WHEEL,sha256=Yd3eJSBM2hj8W-ouaiMfFUwQYAS-D6P73Ob9yN5MZd0,114
100
- QuLab-2.7.12.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
101
- QuLab-2.7.12.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
102
- QuLab-2.7.12.dist-info/RECORD,,
98
+ qulab-2.7.13.dist-info/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
99
+ qulab-2.7.13.dist-info/METADATA,sha256=jcgTSB8rZA06Umse8zUuaxfFLGdyBD4skLwUxqGCUOs,3699
100
+ qulab-2.7.13.dist-info/WHEEL,sha256=QgR3XCD-6bLIVi9XRH__kfiwMJXw7QeWoMWYRnaC8WY,114
101
+ qulab-2.7.13.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
102
+ qulab-2.7.13.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
103
+ qulab-2.7.13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp310-cp310-macosx_10_9_universal2
5
5