QuLab 2.7.11__tar.gz → 2.7.13__tar.gz

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.
Files changed (113) hide show
  1. {qulab-2.7.11 → qulab-2.7.13}/PKG-INFO +1 -1
  2. {qulab-2.7.11 → qulab-2.7.13}/QuLab.egg-info/PKG-INFO +1 -1
  3. {qulab-2.7.11 → qulab-2.7.13}/QuLab.egg-info/SOURCES.txt +1 -0
  4. {qulab-2.7.11 → qulab-2.7.13}/qulab/cli/config.py +16 -1
  5. {qulab-2.7.11 → qulab-2.7.13}/qulab/executor/schedule.py +38 -15
  6. qulab-2.7.13/qulab/tools/__init__.py +39 -0
  7. qulab-2.7.13/qulab/version.py +1 -0
  8. qulab-2.7.11/qulab/version.py +0 -1
  9. {qulab-2.7.11 → qulab-2.7.13}/LICENSE +0 -0
  10. {qulab-2.7.11 → qulab-2.7.13}/MANIFEST.in +0 -0
  11. {qulab-2.7.11 → qulab-2.7.13}/QuLab.egg-info/dependency_links.txt +0 -0
  12. {qulab-2.7.11 → qulab-2.7.13}/QuLab.egg-info/entry_points.txt +0 -0
  13. {qulab-2.7.11 → qulab-2.7.13}/QuLab.egg-info/requires.txt +0 -0
  14. {qulab-2.7.11 → qulab-2.7.13}/QuLab.egg-info/top_level.txt +0 -0
  15. {qulab-2.7.11 → qulab-2.7.13}/README.md +0 -0
  16. {qulab-2.7.11 → qulab-2.7.13}/pyproject.toml +0 -0
  17. {qulab-2.7.11 → qulab-2.7.13}/qulab/__init__.py +0 -0
  18. {qulab-2.7.11 → qulab-2.7.13}/qulab/__main__.py +0 -0
  19. {qulab-2.7.11 → qulab-2.7.13}/qulab/cli/__init__.py +0 -0
  20. {qulab-2.7.11 → qulab-2.7.13}/qulab/cli/commands.py +0 -0
  21. {qulab-2.7.11 → qulab-2.7.13}/qulab/dicttree.py +0 -0
  22. {qulab-2.7.11 → qulab-2.7.13}/qulab/executor/__init__.py +0 -0
  23. {qulab-2.7.11 → qulab-2.7.13}/qulab/executor/cli.py +0 -0
  24. {qulab-2.7.11 → qulab-2.7.13}/qulab/executor/load.py +0 -0
  25. {qulab-2.7.11 → qulab-2.7.13}/qulab/executor/storage.py +0 -0
  26. {qulab-2.7.11 → qulab-2.7.13}/qulab/executor/transform.py +0 -0
  27. {qulab-2.7.11 → qulab-2.7.13}/qulab/executor/utils.py +0 -0
  28. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/__init__.py +0 -0
  29. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/__main__.py +0 -0
  30. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/config.py +0 -0
  31. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/dataset.py +0 -0
  32. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/event_queue.py +0 -0
  33. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/mainwindow.py +0 -0
  34. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/monitor.py +0 -0
  35. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/ploter.py +0 -0
  36. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/qt_compat.py +0 -0
  37. {qulab-2.7.11 → qulab-2.7.13}/qulab/monitor/toolbar.py +0 -0
  38. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/__init__.py +0 -0
  39. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/curd.py +0 -0
  40. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/expression.py +0 -0
  41. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/models.py +0 -0
  42. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/optimize.py +0 -0
  43. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/query.py +0 -0
  44. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/record.py +0 -0
  45. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/scan.py +0 -0
  46. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/server.py +0 -0
  47. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/space.py +0 -0
  48. {qulab-2.7.11 → qulab-2.7.13}/qulab/scan/utils.py +0 -0
  49. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/__init__.py +0 -0
  50. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/__main__.py +0 -0
  51. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/backend/__init__.py +0 -0
  52. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/backend/redis.py +0 -0
  53. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/base_dataset.py +0 -0
  54. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/chunk.py +0 -0
  55. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/dataset.py +0 -0
  56. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/file.py +0 -0
  57. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/__init__.py +0 -0
  58. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/base.py +0 -0
  59. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/config.py +0 -0
  60. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/file.py +0 -0
  61. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/ipy.py +0 -0
  62. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/models.py +0 -0
  63. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/record.py +0 -0
  64. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/report.py +0 -0
  65. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/models/tag.py +0 -0
  66. {qulab-2.7.11 → qulab-2.7.13}/qulab/storage/storage.py +0 -0
  67. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/__init__.py +0 -0
  68. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/chat.py +0 -0
  69. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/device/__init__.py +0 -0
  70. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/device/basedevice.py +0 -0
  71. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/device/loader.py +0 -0
  72. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/device/utils.py +0 -0
  73. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/drivers/FakeInstrument.py +0 -0
  74. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/drivers/__init__.py +0 -0
  75. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/ipy_events.py +0 -0
  76. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/net/__init__.py +0 -0
  77. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/net/bencoder.py +0 -0
  78. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/net/cli.py +0 -0
  79. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/net/dhcp.py +0 -0
  80. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/net/dhcpd.py +0 -0
  81. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/net/kad.py +0 -0
  82. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/net/kcp.py +0 -0
  83. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/net/nginx.py +0 -0
  84. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/progress.py +0 -0
  85. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/__init__.py +0 -0
  86. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/client.py +0 -0
  87. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/exceptions.py +0 -0
  88. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/msgpack.py +0 -0
  89. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/msgpack.pyi +0 -0
  90. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/router.py +0 -0
  91. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/rpc.py +0 -0
  92. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/serialize.py +0 -0
  93. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/server.py +0 -0
  94. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/socket.py +0 -0
  95. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/utils.py +0 -0
  96. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/worker.py +0 -0
  97. {qulab-2.7.11 → qulab-2.7.13}/qulab/sys/rpc/zmq_socket.py +0 -0
  98. {qulab-2.7.11 → qulab-2.7.13}/qulab/typing.py +0 -0
  99. {qulab-2.7.11 → qulab-2.7.13}/qulab/utils.py +0 -0
  100. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/__init__.py +0 -0
  101. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/__main__.py +0 -0
  102. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/_autoplot.py +0 -0
  103. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/plot_circ.py +0 -0
  104. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/plot_layout.py +0 -0
  105. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/plot_seq.py +0 -0
  106. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/qdat.py +0 -0
  107. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/rot3d.py +0 -0
  108. {qulab-2.7.11 → qulab-2.7.13}/qulab/visualization/widgets.py +0 -0
  109. {qulab-2.7.11 → qulab-2.7.13}/setup.cfg +0 -0
  110. {qulab-2.7.11 → qulab-2.7.13}/setup.py +0 -0
  111. {qulab-2.7.11 → qulab-2.7.13}/src/qulab.h +0 -0
  112. {qulab-2.7.11 → qulab-2.7.13}/tests/test_kad.py +0 -0
  113. {qulab-2.7.11 → qulab-2.7.13}/tests/test_scan.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: QuLab
3
- Version: 2.7.11
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,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: QuLab
3
- Version: 2.7.11
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>
@@ -95,6 +95,7 @@ qulab/sys/rpc/socket.py
95
95
  qulab/sys/rpc/utils.py
96
96
  qulab/sys/rpc/worker.py
97
97
  qulab/sys/rpc/zmq_socket.py
98
+ qulab/tools/__init__.py
98
99
  qulab/visualization/__init__.py
99
100
  qulab/visualization/__main__.py
100
101
  qulab/visualization/_autoplot.py
@@ -68,6 +68,10 @@ def log_options(func):
68
68
  type=click.Path(),
69
69
  default=lambda: get_config_value("log", Path),
70
70
  help=f"Log file path")
71
+ @click.option("--debug-log",
72
+ type=click.Path(),
73
+ default=lambda: get_config_value("debug_log", Path),
74
+ help=f"Debug log file path")
71
75
  @click.option("--quiet",
72
76
  is_flag=True,
73
77
  default=get_config_value("quiet", bool),
@@ -76,6 +80,7 @@ def log_options(func):
76
80
  def wrapper(*args, **kwargs):
77
81
  debug = bool(kwargs.pop("debug"))
78
82
  log = kwargs.pop("log")
83
+ debug_log = kwargs.pop("debug_log")
79
84
  quiet = bool(kwargs.pop("quiet"))
80
85
 
81
86
  if debug:
@@ -85,7 +90,17 @@ def log_options(func):
85
90
 
86
91
  handlers = []
87
92
  if log is not None:
88
- handlers.append(dict(sink=log, level=log_level))
93
+ handlers.append(
94
+ dict(sink=log,
95
+ level="INFO",
96
+ rotation="monday at 7:00",
97
+ compression="zip"))
98
+ if debug_log is not None:
99
+ handlers.append(
100
+ dict(sink=debug_log,
101
+ level="DEBUG",
102
+ rotation="monday at 7:00",
103
+ compression="zip"))
89
104
  if not quiet or debug:
90
105
  handlers.append(dict(sink=sys.stderr, level=log_level))
91
106
 
@@ -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
  """
@@ -387,6 +403,7 @@ def diagnose(workflow: WorkflowType, code_path: str | Path,
387
403
  f'"{workflow.__workflow_id__}": All dependents passed, but calibration failed!'
388
404
  )
389
405
  update_parameters(report, state_path)
406
+ logger.debug(f'"{workflow.__workflow_id__}": parameters updated')
390
407
  return True
391
408
 
392
409
 
@@ -451,6 +468,9 @@ def maintain(workflow: WorkflowType,
451
468
  )
452
469
  if not freeze:
453
470
  update_parameters(report, state_path)
471
+ logger.debug(f'"{workflow.__workflow_id__}": parameters updated')
472
+ else:
473
+ logger.debug(f'"{workflow.__workflow_id__}": parameters freezed')
454
474
  return
455
475
 
456
476
 
@@ -471,4 +491,7 @@ def run(workflow: WorkflowType,
471
491
  )
472
492
  if not freeze:
473
493
  update_parameters(report, state_path)
494
+ logger.debug(f'"{workflow.__workflow_id__}": parameters updated')
495
+ else:
496
+ logger.debug(f'"{workflow.__workflow_id__}": parameters freezed')
474
497
  return
@@ -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
+ }
@@ -0,0 +1 @@
1
+ __version__ = "2.7.13"
@@ -1 +0,0 @@
1
- __version__ = "2.7.11"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes