QuLab 2.1.4__cp311-cp311-win_amd64.whl → 2.2.0__cp311-cp311-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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: QuLab
3
- Version: 2.1.4
3
+ Version: 2.2.0
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,7 +1,7 @@
1
1
  qulab/__init__.py,sha256=vkFybY8YSsQilYdThPRD83-btPAR41sy_WCXiM-6mME,141
2
2
  qulab/__main__.py,sha256=V7iokU7awstgjCeiF_hoOdFyrqJwC_4QetiLe7cWvOQ,454
3
- qulab/fun.cp311-win_amd64.pyd,sha256=DejsYo6DVNrnZP6HToBN86HY5ICqbUqWNxGnC0q5t8A,31232
4
- qulab/version.py,sha256=HVJYMyJeujBoXcNkL2sXW9oxWN275q3pivrlKw3Hm3s,21
3
+ qulab/fun.cp311-win_amd64.pyd,sha256=mZjoEtvfAnmQ2U5lxwg5eWrIqY2P3hqMCr9L9Sf8w3o,31744
4
+ qulab/version.py,sha256=j8DDNpniPNhmwry5zUQczzr9Gj6bGU3sUUeXfGl_kKE,21
5
5
  qulab/monitor/__init__.py,sha256=xEVDkJF8issrsDeLqQmDsvtRmrf-UiViFcGTWuzdlFU,43
6
6
  qulab/monitor/__main__.py,sha256=k2H1H5Zf9LLXTDLISJkbikLH-z0f1e5i5i6wXXYPOrE,105
7
7
  qulab/monitor/config.py,sha256=y_5StMkdrbZO1ziyKBrvIkB7Jclp9RCPK1QbsOhCxnY,785
@@ -19,9 +19,9 @@ qulab/scan/models.py,sha256=ZvXkJEt5Yz3Sjx0JKzYka-q2Uo-w_iVzHgH8A6DbjF0,18236
19
19
  qulab/scan/optimize.py,sha256=MlT4y422CnP961IR384UKryyZh8riNvrPSd2z_MXLEg,2356
20
20
  qulab/scan/query.py,sha256=WZeTiEtycP4raqzIUEP6tNg-OMaQYfRCxcdyYP5Swyg,11819
21
21
  qulab/scan/record.py,sha256=K8h8psiT_xgHZem9HRwzEgmr9lE0dGYHjlfK11sHldw,19111
22
- qulab/scan/scan.py,sha256=hBl9BjKfH-PoofhtpaD-O6s37wxy88hBN59GUXAcAuo,34877
22
+ qulab/scan/scan.py,sha256=ndH4heBDf_tuOA33G-0reIZVsUuzpCoJDsXk-xXeRVQ,35811
23
23
  qulab/scan/server.py,sha256=e7AqFmaN9924VYrbvyKwPrVBzqPcnXbT8YwexAN_ZjQ,11911
24
- qulab/scan/space.py,sha256=OPceWIIrb2KDDQaSxD3Vkzkf9NDSuqWuQoDnKiWqtAo,5381
24
+ qulab/scan/space.py,sha256=PBa7Z6KnS690x79WS2YU3PTA_s5K6MCJ6JmS93vs2s4,5381
25
25
  qulab/scan/utils.py,sha256=30qnYvyFyctwcWxOCUpCNxXgGysA7xdIDzYbjwxGUzA,3744
26
26
  qulab/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  qulab/storage/__main__.py,sha256=6-EjN0waX1yfcMPJXqpIr9UlrIEsSCFApm5G-ZeaPMQ,1742
@@ -78,9 +78,9 @@ qulab/visualization/plot_layout.py,sha256=yAnMONOms7_szCdng-8wPpUMPis5UnbaNNzV4K
78
78
  qulab/visualization/plot_seq.py,sha256=h9D0Yl_yO64IwlvBgzMu9EBKr9gg6y8QE55gu2PfTns,2783
79
79
  qulab/visualization/qdat.py,sha256=HubXFu4nfcA7iUzghJGle1C86G6221hicLR0b-GqhKQ,5887
80
80
  qulab/visualization/widgets.py,sha256=HcYwdhDtLreJiYaZuN3LfofjJmZcLwjMfP5aasebgDo,3266
81
- QuLab-2.1.4.dist-info/LICENSE,sha256=b4NRQ-GFVpJMT7RuExW3NwhfbrYsX7AcdB7Gudok-fs,1086
82
- QuLab-2.1.4.dist-info/METADATA,sha256=viS-wETLJCqd-ugZW2Ac_Z_pl1_BGi8KbBXhrlxj2qs,3609
83
- QuLab-2.1.4.dist-info/WHEEL,sha256=nSybvzWlmdJnHiUQSY-d7V1ycwEVUTqXiTvr2eshg44,102
84
- QuLab-2.1.4.dist-info/entry_points.txt,sha256=ohBzutEnQimP_BZWiuXdSliu4QAYSHHcN0PZD8c7ZCY,46
85
- QuLab-2.1.4.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
86
- QuLab-2.1.4.dist-info/RECORD,,
81
+ QuLab-2.2.0.dist-info/LICENSE,sha256=b4NRQ-GFVpJMT7RuExW3NwhfbrYsX7AcdB7Gudok-fs,1086
82
+ QuLab-2.2.0.dist-info/METADATA,sha256=vLSXtsZtAzrGYscJu107F0XhgtNJWzTXzT0Y0DHITKw,3609
83
+ QuLab-2.2.0.dist-info/WHEEL,sha256=nSybvzWlmdJnHiUQSY-d7V1ycwEVUTqXiTvr2eshg44,102
84
+ QuLab-2.2.0.dist-info/entry_points.txt,sha256=ohBzutEnQimP_BZWiuXdSliu4QAYSHHcN0PZD8c7ZCY,46
85
+ QuLab-2.2.0.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
86
+ QuLab-2.2.0.dist-info/RECORD,,
Binary file
qulab/scan/scan.py CHANGED
@@ -332,7 +332,17 @@ class Scan():
332
332
  async def _emit(self, current_level, step, position, variables: dict[str,
333
333
  Any]):
334
334
  for key, value in list(variables.items()):
335
- if inspect.isawaitable(value) and not self.hiden(key):
335
+ if key.startswith('**'):
336
+ if isinstance(value, dict):
337
+ variables.update(value)
338
+ del variables[key]
339
+ elif inspect.isawaitable(value):
340
+ d = await value
341
+ assert isinstance(
342
+ d, dict), f"Should promise a dict for `**` symbol."
343
+ variables.update(d)
344
+ del variables[key]
345
+ elif inspect.isawaitable(value) and not self.hiden(key):
336
346
  variables[key] = await value
337
347
  if self._sock is not None:
338
348
  await self._sock.send_pyobj({
@@ -362,7 +372,8 @@ class Scan():
362
372
  self._hide_pattern_re = re.compile('|'.join(self.description['hiden']))
363
373
 
364
374
  def hiden(self, name: str) -> bool:
365
- return bool(self._hide_pattern_re.match(name))
375
+ return bool(
376
+ self._hide_pattern_re.match(name)) and not name.startswith('**')
366
377
 
367
378
  async def _filter(self, variables: dict[str, Any], level: int = 0):
368
379
  try:
@@ -971,9 +982,21 @@ async def _iter_level(variables,
971
982
 
972
983
  variables.update(await call_many_functions(order, getters, variables))
973
984
 
985
+ if opts:
986
+ for key in list(variables.keys()):
987
+ if key.startswith('**'):
988
+ d = variables[key]
989
+ if inspect.isawaitable(d):
990
+ d = await d
991
+ assert isinstance(
992
+ d, dict), f"Should promise a dict for `**` symbol."
993
+ variables.update(d)
994
+ del variables[key]
995
+
974
996
  for name, opt in opts.items():
975
997
  opt_cfg = optimizers[name]
976
998
  args = [variables[n] for n in opt_cfg.dimensions.keys()]
999
+
977
1000
  if name not in variables:
978
1001
  raise ValueError(f'{name} not in variables.')
979
1002
  fun = variables[name]
qulab/scan/space.py CHANGED
@@ -23,11 +23,11 @@ class Space():
23
23
  return len(self.toarray())
24
24
 
25
25
  @classmethod
26
- def fromarray(cls, array):
27
- if isinstance(array, Space):
28
- return array
29
- if isinstance(array, (list, tuple)):
30
- array = np.array(array)
26
+ def fromarray(cls, space):
27
+ if isinstance(space, Space):
28
+ return space
29
+ if isinstance(space, (list, tuple)):
30
+ array = np.array(space)
31
31
  try:
32
32
  a = np.linspace(array[0], array[-1], len(array), dtype=array.dtype)
33
33
  if np.allclose(a, array):
@@ -81,7 +81,7 @@ class Space():
81
81
  dtype=array.dtype)
82
82
  except:
83
83
  pass
84
- return array
84
+ return space
85
85
 
86
86
  def toarray(self):
87
87
  return getattr(np, self.function)(*self.args, **self.kwds)
qulab/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.1.4"
1
+ __version__ = "2.2.0"
File without changes
File without changes