QuLab 2.4.2__tar.gz → 2.4.3__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 (107) hide show
  1. {qulab-2.4.2 → qulab-2.4.3}/PKG-INFO +1 -1
  2. {qulab-2.4.2 → qulab-2.4.3}/QuLab.egg-info/PKG-INFO +1 -1
  3. {qulab-2.4.2 → qulab-2.4.3}/qulab/executor/schedule.py +32 -17
  4. {qulab-2.4.2 → qulab-2.4.3}/qulab/executor/storage.py +6 -2
  5. qulab-2.4.3/qulab/version.py +1 -0
  6. qulab-2.4.2/qulab/version.py +0 -1
  7. {qulab-2.4.2 → qulab-2.4.3}/LICENSE +0 -0
  8. {qulab-2.4.2 → qulab-2.4.3}/MANIFEST.in +0 -0
  9. {qulab-2.4.2 → qulab-2.4.3}/QuLab.egg-info/SOURCES.txt +0 -0
  10. {qulab-2.4.2 → qulab-2.4.3}/QuLab.egg-info/dependency_links.txt +0 -0
  11. {qulab-2.4.2 → qulab-2.4.3}/QuLab.egg-info/entry_points.txt +0 -0
  12. {qulab-2.4.2 → qulab-2.4.3}/QuLab.egg-info/requires.txt +0 -0
  13. {qulab-2.4.2 → qulab-2.4.3}/QuLab.egg-info/top_level.txt +0 -0
  14. {qulab-2.4.2 → qulab-2.4.3}/README.md +0 -0
  15. {qulab-2.4.2 → qulab-2.4.3}/pyproject.toml +0 -0
  16. {qulab-2.4.2 → qulab-2.4.3}/qulab/__init__.py +0 -0
  17. {qulab-2.4.2 → qulab-2.4.3}/qulab/__main__.py +0 -0
  18. {qulab-2.4.2 → qulab-2.4.3}/qulab/dicttree.py +0 -0
  19. {qulab-2.4.2 → qulab-2.4.3}/qulab/executor/__init__.py +0 -0
  20. {qulab-2.4.2 → qulab-2.4.3}/qulab/executor/__main__.py +0 -0
  21. {qulab-2.4.2 → qulab-2.4.3}/qulab/executor/load.py +0 -0
  22. {qulab-2.4.2 → qulab-2.4.3}/qulab/executor/transform.py +0 -0
  23. {qulab-2.4.2 → qulab-2.4.3}/qulab/executor/utils.py +0 -0
  24. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/__init__.py +0 -0
  25. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/__main__.py +0 -0
  26. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/config.py +0 -0
  27. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/dataset.py +0 -0
  28. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/event_queue.py +0 -0
  29. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/mainwindow.py +0 -0
  30. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/monitor.py +0 -0
  31. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/ploter.py +0 -0
  32. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/qt_compat.py +0 -0
  33. {qulab-2.4.2 → qulab-2.4.3}/qulab/monitor/toolbar.py +0 -0
  34. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/__init__.py +0 -0
  35. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/curd.py +0 -0
  36. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/expression.py +0 -0
  37. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/models.py +0 -0
  38. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/optimize.py +0 -0
  39. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/query.py +0 -0
  40. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/record.py +0 -0
  41. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/scan.py +0 -0
  42. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/server.py +0 -0
  43. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/space.py +0 -0
  44. {qulab-2.4.2 → qulab-2.4.3}/qulab/scan/utils.py +0 -0
  45. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/__init__.py +0 -0
  46. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/__main__.py +0 -0
  47. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/backend/__init__.py +0 -0
  48. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/backend/redis.py +0 -0
  49. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/base_dataset.py +0 -0
  50. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/chunk.py +0 -0
  51. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/dataset.py +0 -0
  52. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/file.py +0 -0
  53. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/__init__.py +0 -0
  54. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/base.py +0 -0
  55. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/config.py +0 -0
  56. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/file.py +0 -0
  57. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/ipy.py +0 -0
  58. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/models.py +0 -0
  59. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/record.py +0 -0
  60. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/report.py +0 -0
  61. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/models/tag.py +0 -0
  62. {qulab-2.4.2 → qulab-2.4.3}/qulab/storage/storage.py +0 -0
  63. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/__init__.py +0 -0
  64. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/chat.py +0 -0
  65. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/device/__init__.py +0 -0
  66. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/device/basedevice.py +0 -0
  67. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/device/loader.py +0 -0
  68. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/device/utils.py +0 -0
  69. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/drivers/FakeInstrument.py +0 -0
  70. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/drivers/__init__.py +0 -0
  71. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/ipy_events.py +0 -0
  72. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/net/__init__.py +0 -0
  73. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/net/bencoder.py +0 -0
  74. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/net/cli.py +0 -0
  75. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/net/dhcp.py +0 -0
  76. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/net/dhcpd.py +0 -0
  77. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/net/kad.py +0 -0
  78. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/net/kcp.py +0 -0
  79. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/net/nginx.py +0 -0
  80. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/progress.py +0 -0
  81. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/__init__.py +0 -0
  82. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/client.py +0 -0
  83. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/exceptions.py +0 -0
  84. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/msgpack.py +0 -0
  85. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/msgpack.pyi +0 -0
  86. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/router.py +0 -0
  87. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/rpc.py +0 -0
  88. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/serialize.py +0 -0
  89. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/server.py +0 -0
  90. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/socket.py +0 -0
  91. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/utils.py +0 -0
  92. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/worker.py +0 -0
  93. {qulab-2.4.2 → qulab-2.4.3}/qulab/sys/rpc/zmq_socket.py +0 -0
  94. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/__init__.py +0 -0
  95. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/__main__.py +0 -0
  96. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/_autoplot.py +0 -0
  97. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/plot_circ.py +0 -0
  98. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/plot_layout.py +0 -0
  99. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/plot_seq.py +0 -0
  100. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/qdat.py +0 -0
  101. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/rot3d.py +0 -0
  102. {qulab-2.4.2 → qulab-2.4.3}/qulab/visualization/widgets.py +0 -0
  103. {qulab-2.4.2 → qulab-2.4.3}/setup.cfg +0 -0
  104. {qulab-2.4.2 → qulab-2.4.3}/setup.py +0 -0
  105. {qulab-2.4.2 → qulab-2.4.3}/src/qulab.h +0 -0
  106. {qulab-2.4.2 → qulab-2.4.3}/tests/test_kad.py +0 -0
  107. {qulab-2.4.2 → qulab-2.4.3}/tests/test_scan.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: QuLab
3
- Version: 2.4.2
3
+ Version: 2.4.3
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.4.2
3
+ Version: 2.4.3
4
4
  Summary: contral instruments and manage data
5
5
  Author-email: feihoo87 <feihoo87@gmail.com>
6
6
  Maintainer-email: feihoo87 <feihoo87@gmail.com>
@@ -7,8 +7,8 @@ from loguru import logger
7
7
 
8
8
  from . import transform
9
9
  from .load import load_workflow
10
- from .storage import (Result, find_result, renew_result, revoke_result,
11
- save_result)
10
+ from .storage import (Result, find_result, get_head, renew_result,
11
+ revoke_result, save_result)
12
12
 
13
13
 
14
14
  class CalibrationFailedError(Exception):
@@ -59,6 +59,20 @@ 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):
63
+ if check:
64
+ result = transform.params_to_result(
65
+ node.check_analyze(*data,
66
+ history=transform.result_to_params(history)))
67
+ result.fully_calibrated = False
68
+ else:
69
+ result = transform.params_to_result(
70
+ node.analyze(*data, history=transform.result_to_params(history)))
71
+ result.fully_calibrated = True
72
+ result.data = data
73
+ return result
74
+
75
+
62
76
  @functools.lru_cache(maxsize=128)
63
77
  def check_data(workflow: str, code_path: str | Path, state_path: str | Path,
64
78
  session_id: str) -> Result:
@@ -90,11 +104,12 @@ def check_data(workflow: str, code_path: str | Path, state_path: str | Path,
90
104
  node, 'check_analyze') and callable(node.check_analyze):
91
105
  logger.debug(f'Checking "{workflow}" with "check" method ...')
92
106
  data = node.check()
93
- logger.debug(f'Checked "{workflow}" !')
94
- result = transform.params_to_result(
95
- node.check_analyze(*data,
96
- history=transform.result_to_params(history)))
107
+ result = Result()
97
108
  result.data = data
109
+ save_result(workflow, result, state_path)
110
+
111
+ logger.debug(f'Checked "{workflow}" !')
112
+ result = call_analyzer(node, data, history, check=True)
98
113
  if result.in_spec:
99
114
  logger.debug(f'"{workflow}": checked in spec, renewing result')
100
115
  renew_result(workflow, state_path)
@@ -104,31 +119,32 @@ def check_data(workflow: str, code_path: str | Path, state_path: str | Path,
104
119
  else:
105
120
  logger.debug(f'Checking "{workflow}" with "calibrate" method ...')
106
121
  data = node.calibrate()
107
- logger.debug(f'Calibrated "{workflow}" !')
108
- result = transform.params_to_result(
109
- node.analyze(*data, history=transform.result_to_params(history)))
122
+ result = Result()
110
123
  result.data = data
111
- result.fully_calibrated = True
112
124
  save_result(workflow, result, state_path)
113
125
 
126
+ logger.debug(f'Calibrated "{workflow}" !')
127
+ result = call_analyzer(node, data, history, check=False)
128
+ save_result(workflow, result, state_path,
129
+ get_head(workflow, state_path))
130
+
114
131
  return result
115
132
 
116
133
 
117
134
  @functools.lru_cache(maxsize=128)
118
135
  def calibrate(workflow, code_path: str | Path, state_path: str | Path,
119
136
  session_id: str) -> Result:
120
- result = Result()
121
137
  node = load_workflow(workflow, code_path)
122
138
  history = find_result(workflow, state_path)
123
139
 
124
140
  logger.debug(f'Calibrating "{workflow}" ...')
125
141
  data = node.calibrate()
126
- logger.debug(f'Calibrated "{workflow}" !')
127
- result = transform.params_to_result(
128
- node.analyze(*data, history=transform.result_to_params(history)))
142
+ result = Result()
129
143
  result.data = data
130
- result.fully_calibrated = True
131
144
  save_result(workflow, result, state_path)
145
+ logger.debug(f'Calibrated "{workflow}" !')
146
+ result = call_analyzer(node, data, history, check=False)
147
+ save_result(workflow, result, state_path, get_head(workflow, state_path))
132
148
  return result
133
149
 
134
150
 
@@ -212,8 +228,7 @@ def maintain(node,
212
228
  return
213
229
 
214
230
 
215
- def run(node, code_path: str | Path,
216
- state_path: str | Path):
231
+ def run(node, code_path: str | Path, state_path: str | Path):
217
232
  logger.debug(f'run "{node}" without dependences.')
218
233
  result = calibrate(node, code_path, state_path)
219
234
  if result.bad_data or not result.in_spec:
@@ -47,12 +47,16 @@ def random_path(base: Path) -> Path:
47
47
  return path
48
48
 
49
49
 
50
- def save_result(workflow: str, result: Result, base_path: str | Path):
50
+ def save_result(workflow: str,
51
+ result: Result,
52
+ base_path: str | Path,
53
+ path: Path | None = None):
51
54
  logger.debug(
52
55
  f'Saving result for "{workflow}", {result.in_spec=}, {result.bad_data=}, {result.fully_calibrated=}'
53
56
  )
54
57
  base_path = Path(base_path)
55
- path = random_path(base_path)
58
+ if path is None:
59
+ path = random_path(base_path)
56
60
  (base_path / 'objects' / path).parent.mkdir(parents=True, exist_ok=True)
57
61
  result.previous = get_head(workflow, base_path)
58
62
  with open(base_path / 'objects' / path, "wb") as f:
@@ -0,0 +1 @@
1
+ __version__ = "2.4.3"
@@ -1 +0,0 @@
1
- __version__ = "2.4.2"
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes