QuLab 2.7.12__cp312-cp312-win_amd64.whl → 2.7.13__cp312-cp312-win_amd64.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=RZme5maBSMZpP6ckXymqZpo2sRYttwEpTYCIzIvys1c,292
2
2
  qulab/__main__.py,sha256=FL4YsGZL1jEtmcPc5WbleArzhOHLMsWl7OH3O-1d1ss,72
3
3
  qulab/dicttree.py,sha256=ZoSJVWK4VMqfzj42gPb_n5RqLlM6K1Me0WmLIfLEYf8,14195
4
- qulab/fun.cp312-win_amd64.pyd,sha256=4ay6ziBEgPh79ieqQL46fH-wIWOT_CGndrZSXtUFsQM,32256
4
+ qulab/fun.cp312-win_amd64.pyd,sha256=9AH9Jm8y-pPHSkgqN-4Jw_3aQoqecLyq8H-V9QBembU,32256
5
5
  qulab/typing.py,sha256=PRtwbCHWY2ROKK8GHq4Bo8llXrIGo6xC73DrQf7S9os,71
6
6
  qulab/utils.py,sha256=UyZNPIyvis5t2MJBkXXLO5EmYP3mQZbt87zmYAHgoyk,1291
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=6xd2eYw32k1NmfAuYSu__1kaP12Oz1QVqwbkYXdWno4,588
10
10
  qulab/cli/config.py,sha256=7h3k0K8FYHhI6LVWt8BoDdKrX2ApFDBAUAUuXhHwst4,3799
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=W3bPwe8um1IeR_3HLx-ad6iCcbeuUQcSg11Ze4w6DJg,742
85
85
  qulab/sys/rpc/utils.py,sha256=BurIcqh8CS-Hsk1dYP6IiefK4qHivaEqD9_rBY083SA,619
86
86
  qulab/sys/rpc/worker.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
87
87
  qulab/sys/rpc/zmq_socket.py,sha256=aoIm-C-IdJjm9_PQXckvbqTxc9kCeJrT4PyYytoDIHo,8492
88
+ qulab/tools/__init__.py,sha256=-qZJcLsfueyHMihcbMp3HU3VRwz8zB0wnlosSjKp6R0,985
88
89
  qulab/visualization/__init__.py,sha256=Bkt9AK5c45d6HFLlT-f8cIppywXziHtJqhDtVxOoKKo,6317
89
90
  qulab/visualization/__main__.py,sha256=WduINFl21B-XMsi2rg2cVhIyU11hKKX3zOsjc56QLiQ,1710
90
91
  qulab/visualization/_autoplot.py,sha256=gK3m5STiUigcQdJ3NzqD5jEITkPAsTsWMnmw6nUJfvE,14629
@@ -94,9 +95,9 @@ qulab/visualization/plot_seq.py,sha256=Uo1-dB1YE9IN_A9tuaOs9ZG3S5dKDQ_l98iD2Wbxp
94
95
  qulab/visualization/qdat.py,sha256=HubXFu4nfcA7iUzghJGle1C86G6221hicLR0b-GqhKQ,5887
95
96
  qulab/visualization/rot3d.py,sha256=jGHJcqj1lEWBUV-W4GUGONGacqjrYvuFoFCwPse5h1Y,757
96
97
  qulab/visualization/widgets.py,sha256=HcYwdhDtLreJiYaZuN3LfofjJmZcLwjMfP5aasebgDo,3266
97
- QuLab-2.7.12.dist-info/LICENSE,sha256=b4NRQ-GFVpJMT7RuExW3NwhfbrYsX7AcdB7Gudok-fs,1086
98
- QuLab-2.7.12.dist-info/METADATA,sha256=4oRSl28x1dKvEJco6x9J3NWas5V_zzklpGnCgIe1NHE,3804
99
- QuLab-2.7.12.dist-info/WHEEL,sha256=cRmSBGD-cl98KkuHMNqv9Ac9L9_VqTvcBYwpIvxN0cg,101
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=b4NRQ-GFVpJMT7RuExW3NwhfbrYsX7AcdB7Gudok-fs,1086
99
+ qulab-2.7.13.dist-info/METADATA,sha256=xjqn4NNAHSvgY79ASBUx7tCaHHqJ_vQVkAH62v4sEJY,3804
100
+ qulab-2.7.13.dist-info/WHEEL,sha256=GNSMLKsI4JcODC8iIUwfCC2mP5aj3pHj8CNqlVH-mAI,101
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: cp312-cp312-win_amd64
5
5