QuLab 2.10.5__tar.gz → 2.10.6__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 (118) hide show
  1. {qulab-2.10.5 → qulab-2.10.6}/PKG-INFO +1 -1
  2. {qulab-2.10.5 → qulab-2.10.6}/QuLab.egg-info/PKG-INFO +1 -1
  3. {qulab-2.10.5 → qulab-2.10.6}/QuLab.egg-info/SOURCES.txt +1 -1
  4. {qulab-2.10.5 → qulab-2.10.6}/qulab/dicttree.py +19 -7
  5. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/load.py +7 -7
  6. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/registry.py +11 -7
  7. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/__init__.py +0 -1
  8. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/scan.py +3 -2
  9. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/utils.py +1 -1
  10. qulab-2.10.6/qulab/version.py +1 -0
  11. {qulab-2.10.5 → qulab-2.10.6}/tests/test_expression.py +1 -1
  12. qulab-2.10.5/qulab/version.py +0 -1
  13. {qulab-2.10.5 → qulab-2.10.6}/LICENSE +0 -0
  14. {qulab-2.10.5 → qulab-2.10.6}/MANIFEST.in +0 -0
  15. {qulab-2.10.5 → qulab-2.10.6}/QuLab.egg-info/dependency_links.txt +0 -0
  16. {qulab-2.10.5 → qulab-2.10.6}/QuLab.egg-info/entry_points.txt +0 -0
  17. {qulab-2.10.5 → qulab-2.10.6}/QuLab.egg-info/requires.txt +0 -0
  18. {qulab-2.10.5 → qulab-2.10.6}/QuLab.egg-info/top_level.txt +0 -0
  19. {qulab-2.10.5 → qulab-2.10.6}/README.md +0 -0
  20. {qulab-2.10.5 → qulab-2.10.6}/pyproject.toml +0 -0
  21. {qulab-2.10.5 → qulab-2.10.6}/qulab/__init__.py +0 -0
  22. {qulab-2.10.5 → qulab-2.10.6}/qulab/__main__.py +0 -0
  23. {qulab-2.10.5 → qulab-2.10.6}/qulab/cli/__init__.py +0 -0
  24. {qulab-2.10.5 → qulab-2.10.6}/qulab/cli/commands.py +0 -0
  25. {qulab-2.10.5 → qulab-2.10.6}/qulab/cli/config.py +0 -0
  26. {qulab-2.10.5 → qulab-2.10.6}/qulab/cli/decorators.py +0 -0
  27. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/__init__.py +0 -0
  28. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/analyze.py +0 -0
  29. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/cli.py +0 -0
  30. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/schedule.py +0 -0
  31. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/storage.py +0 -0
  32. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/template.py +0 -0
  33. {qulab-2.10.5 → qulab-2.10.6}/qulab/executor/utils.py +0 -0
  34. {qulab-2.10.5/qulab/scan → qulab-2.10.6/qulab}/expression.py +0 -0
  35. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/__init__.py +0 -0
  36. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/__main__.py +0 -0
  37. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/config.py +0 -0
  38. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/dataset.py +0 -0
  39. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/event_queue.py +0 -0
  40. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/mainwindow.py +0 -0
  41. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/monitor.py +0 -0
  42. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/ploter.py +0 -0
  43. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/qt_compat.py +0 -0
  44. {qulab-2.10.5 → qulab-2.10.6}/qulab/monitor/toolbar.py +0 -0
  45. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/curd.py +0 -0
  46. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/models.py +0 -0
  47. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/optimize.py +0 -0
  48. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/query.py +0 -0
  49. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/record.py +0 -0
  50. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/server.py +0 -0
  51. {qulab-2.10.5 → qulab-2.10.6}/qulab/scan/space.py +0 -0
  52. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/__init__.py +0 -0
  53. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/__main__.py +0 -0
  54. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/backend/__init__.py +0 -0
  55. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/backend/redis.py +0 -0
  56. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/base_dataset.py +0 -0
  57. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/chunk.py +0 -0
  58. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/dataset.py +0 -0
  59. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/file.py +0 -0
  60. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/__init__.py +0 -0
  61. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/base.py +0 -0
  62. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/config.py +0 -0
  63. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/file.py +0 -0
  64. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/ipy.py +0 -0
  65. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/models.py +0 -0
  66. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/record.py +0 -0
  67. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/report.py +0 -0
  68. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/models/tag.py +0 -0
  69. {qulab-2.10.5 → qulab-2.10.6}/qulab/storage/storage.py +0 -0
  70. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/__init__.py +0 -0
  71. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/chat.py +0 -0
  72. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/device/__init__.py +0 -0
  73. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/device/basedevice.py +0 -0
  74. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/device/loader.py +0 -0
  75. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/device/utils.py +0 -0
  76. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/drivers/FakeInstrument.py +0 -0
  77. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/drivers/__init__.py +0 -0
  78. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/ipy_events.py +0 -0
  79. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/net/__init__.py +0 -0
  80. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/net/bencoder.py +0 -0
  81. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/net/cli.py +0 -0
  82. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/net/dhcp.py +0 -0
  83. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/net/dhcpd.py +0 -0
  84. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/net/kad.py +0 -0
  85. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/net/kcp.py +0 -0
  86. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/net/nginx.py +0 -0
  87. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/progress.py +0 -0
  88. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/__init__.py +0 -0
  89. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/client.py +0 -0
  90. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/exceptions.py +0 -0
  91. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/msgpack.py +0 -0
  92. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/msgpack.pyi +0 -0
  93. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/router.py +0 -0
  94. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/rpc.py +0 -0
  95. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/serialize.py +0 -0
  96. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/server.py +0 -0
  97. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/socket.py +0 -0
  98. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/utils.py +0 -0
  99. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/worker.py +0 -0
  100. {qulab-2.10.5 → qulab-2.10.6}/qulab/sys/rpc/zmq_socket.py +0 -0
  101. {qulab-2.10.5 → qulab-2.10.6}/qulab/tools/__init__.py +0 -0
  102. {qulab-2.10.5 → qulab-2.10.6}/qulab/tools/connection_helper.py +0 -0
  103. {qulab-2.10.5 → qulab-2.10.6}/qulab/typing.py +0 -0
  104. {qulab-2.10.5 → qulab-2.10.6}/qulab/utils.py +0 -0
  105. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/__init__.py +0 -0
  106. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/__main__.py +0 -0
  107. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/_autoplot.py +0 -0
  108. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/plot_circ.py +0 -0
  109. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/plot_layout.py +0 -0
  110. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/plot_seq.py +0 -0
  111. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/qdat.py +0 -0
  112. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/rot3d.py +0 -0
  113. {qulab-2.10.5 → qulab-2.10.6}/qulab/visualization/widgets.py +0 -0
  114. {qulab-2.10.5 → qulab-2.10.6}/setup.cfg +0 -0
  115. {qulab-2.10.5 → qulab-2.10.6}/setup.py +0 -0
  116. {qulab-2.10.5 → qulab-2.10.6}/src/qulab.h +0 -0
  117. {qulab-2.10.5 → qulab-2.10.6}/tests/test_kad.py +0 -0
  118. {qulab-2.10.5 → qulab-2.10.6}/tests/test_scan.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QuLab
3
- Version: 2.10.5
3
+ Version: 2.10.6
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.4
2
2
  Name: QuLab
3
- Version: 2.10.5
3
+ Version: 2.10.6
4
4
  Summary: contral instruments and manage data
5
5
  Author-email: feihoo87 <feihoo87@gmail.com>
6
6
  Maintainer-email: feihoo87 <feihoo87@gmail.com>
@@ -12,6 +12,7 @@ QuLab.egg-info/top_level.txt
12
12
  qulab/__init__.py
13
13
  qulab/__main__.py
14
14
  qulab/dicttree.py
15
+ qulab/expression.py
15
16
  qulab/typing.py
16
17
  qulab/utils.py
17
18
  qulab/version.py
@@ -40,7 +41,6 @@ qulab/monitor/qt_compat.py
40
41
  qulab/monitor/toolbar.py
41
42
  qulab/scan/__init__.py
42
43
  qulab/scan/curd.py
43
- qulab/scan/expression.py
44
44
  qulab/scan/models.py
45
45
  qulab/scan/optimize.py
46
46
  qulab/scan/query.py
@@ -297,8 +297,8 @@ def update_tree(result, updates):
297
297
  return result
298
298
 
299
299
 
300
- def queryref_tree(q, keys, dct, prefix=[], chain=None):
301
- q = q[1:]
300
+ def queryref_tree(q: str, keys, dct, prefix=[], chain=None):
301
+ q = q.removeprefix('$')
302
302
  if q.startswith('.'):
303
303
  while q.startswith('.'):
304
304
  keys.pop()
@@ -340,7 +340,7 @@ class Env():
340
340
  self.prefix = prefix
341
341
 
342
342
  def get(self, name):
343
- return queryref_tree(name[1:],
343
+ return queryref_tree(name,
344
344
  self.keys,
345
345
  self.dct,
346
346
  prefix=self.prefix,
@@ -405,8 +405,9 @@ internal_functions = {
405
405
 
406
406
 
407
407
  def eval_expr(expression, env=None, functions=None):
408
- from pyparsing import (Forward, Literal, ParseResults, Suppress, Word,
409
- alphanums, delimitedList, infixNotation, oneOf,
408
+ from pyparsing import (Combine, Forward, Literal, MatchFirst, ParseResults,
409
+ Regex, Suppress, Word, ZeroOrMore, alphanums,
410
+ alphas, delimitedList, infixNotation, oneOf,
410
411
  opAssoc, pyparsing_common)
411
412
  if functions is None:
412
413
  functions = internal_functions
@@ -436,8 +437,19 @@ def eval_expr(expression, env=None, functions=None):
436
437
  'e': math.e
437
438
  }.get(t[0]))
438
439
 
439
- variable = Word("$", alphanums +
440
- "._").setParseAction(lambda s, l, t: lookup(t[0]))
440
+ identifier = Word(alphas + '_', alphanums + '_')
441
+ dollar = Literal('$')
442
+ dot_sequence = Regex(r'\.{1,}')
443
+ attr = Combine(Literal('.') + identifier)
444
+ attr_chain = ZeroOrMore(attr)
445
+ dollar_named_chain = Combine(dollar + identifier + attr_chain)
446
+ dollar_dotN_chain = Combine(dollar + dot_sequence + identifier +
447
+ attr_chain)
448
+ dollar_simple = Combine(dollar + identifier)
449
+
450
+ variable = MatchFirst(
451
+ [dollar_dotN_chain, dollar_named_chain,
452
+ dollar_simple]).setParseAction(lambda s, l, t: lookup(t[0]))
441
453
 
442
454
  bracket = Suppress('(') + expr + Suppress(')')
443
455
  bracket.setParseAction(lambda s, l, t: t[0])
@@ -1,10 +1,10 @@
1
1
  import atexit
2
2
  import inspect
3
- import pickle
4
3
  import os
5
- import time
4
+ import pickle
6
5
  import shutil
7
6
  import tempfile
7
+ import time
8
8
  import warnings
9
9
  from importlib.util import module_from_spec, spec_from_file_location
10
10
  from pathlib import Path
@@ -13,6 +13,7 @@ from typing import Any
13
13
 
14
14
  from loguru import logger
15
15
 
16
+ from .registry import Registry
16
17
  from .storage import Report
17
18
  from .template import (TemplateKeyError, TemplateTypeError, decode_mapping,
18
19
  inject_mapping)
@@ -31,17 +32,16 @@ class SetConfigWorkflow():
31
32
  return []
32
33
 
33
34
  def check_state(self, history: Report) -> bool:
34
- from . import transform
35
+ reg = Registry()
35
36
  try:
36
- return self._equal(history.parameters[self.key],
37
- transform.query_config(self.key))
37
+ return self._equal(history.parameters[self.key], reg.get(self.key))
38
38
  except:
39
39
  return False
40
40
 
41
41
  def calibrate(self):
42
- from . import transform
42
+ reg = Registry()
43
43
  try:
44
- value = transform.query_config(self.key)
44
+ value = reg.get(self.key)
45
45
  except:
46
46
  value = eval(input(f'"{self.key}": '))
47
47
  return value
@@ -129,7 +129,7 @@ def set_config_api(query_method,
129
129
  clear_method: The clear method.
130
130
  the method should clear the config.
131
131
  """
132
- global query_config, update_config, delete_config, export_config, clear_config
132
+ global query_config, update_config, delete_config, export_config, clear_config, _api
133
133
 
134
134
  query_config = query_method
135
135
  update_config = update_method
@@ -159,23 +159,27 @@ _init()
159
159
 
160
160
  class Registry():
161
161
 
162
+ def __init__(self):
163
+ self.api = (query_config, update_config, delete_config, export_config,
164
+ clear_config)
165
+
162
166
  def query(self, key: str) -> Any:
163
- return query_config(key)
167
+ return self.api[0](key)
164
168
 
165
169
  def get(self, key: str) -> Any:
166
170
  return self.query(key)
167
171
 
168
172
  def export(self) -> dict[str, dict[str, Any]]:
169
- return export_config()
173
+ return self.api[3]()
170
174
 
171
175
  def set(self, key: str, value: Any):
172
- return update_config({key: value})
176
+ return self.api[1]({key: value})
173
177
 
174
178
  def delete(self, key: str):
175
- return delete_config(key)
179
+ return self.api[2](key)
176
180
 
177
181
  def clear(self):
178
- return clear_config()
182
+ return self.api[4]()
179
183
 
180
184
  def update(self, parameters: dict[str, Any]):
181
- return update_config(parameters)
185
+ return self.api[1](parameters)
@@ -1,3 +1,2 @@
1
- from .expression import Expression, Symbol
2
1
  from .query import get_record, load_record, lookup, lookup_list
3
2
  from .scan import Scan
@@ -18,8 +18,8 @@ import dill
18
18
  import numpy as np
19
19
  import zmq
20
20
 
21
+ from ..expression import Env, Expression, Symbol
21
22
  from ..sys.rpc.zmq_socket import ZMQContextManager
22
- from .expression import Env, Expression, Symbol
23
23
  from .optimize import NgOptimizer
24
24
  from .record import Record
25
25
  from .server import default_record_port
@@ -509,7 +509,8 @@ class Scan():
509
509
 
510
510
  if self.config:
511
511
  self.description['config'] = await create_config(
512
- self._raw_config_copy, self.description['database'], self._sock)
512
+ self._raw_config_copy, self.description['database'],
513
+ self._sock)
513
514
  if current_notebook() is None:
514
515
  await create_notebook('untitle', self.description['database'],
515
516
  self._sock)
@@ -11,7 +11,7 @@ from typing import Any, Callable
11
11
 
12
12
  import dill
13
13
 
14
- from .expression import Env, Expression
14
+ from ..expression import Env, Expression
15
15
 
16
16
 
17
17
  class Unpicklable:
@@ -0,0 +1 @@
1
+ __version__ = "2.10.6"
@@ -4,7 +4,7 @@ import operator
4
4
  import numpy as np
5
5
  import pytest
6
6
 
7
- from qulab.scan.expression import Env, calc
7
+ from qulab.expression import Env, calc
8
8
 
9
9
 
10
10
  # ----------------------------
@@ -1 +0,0 @@
1
- __version__ = "2.10.5"
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