QuLab 2.9.1__cp310-cp310-macosx_10_9_universal2.whl → 2.9.2__cp310-cp310-macosx_10_9_universal2.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.
@@ -208,20 +208,25 @@ def inject_mapping(source: str, mapping: dict[str, Any],
208
208
  lines[end_lineno - 1]) - length_of_last_line
209
209
  else:
210
210
  pattern = re.compile(
211
- r'VAR\s*\(\s*' # VAR(
212
- r'(["\'])(\w+)\1' # 第一个参数(引号包裹的变量名)
213
- r'(?:\s*,\s*(.*?))?' # 可选的其他参数
214
- r'\s*\)', # 闭合括号
215
- re.DOTALL # 允许.匹配换行符
211
+ r'VAR\s*\(\s*' # VAR(
212
+ r'(["\'])(\w+)\1' # 捕获引号和变量名
213
+ r'(?:\s*,\s*default\s*=\s*' # 匹配 default 参数
214
+ r'([^),]*)' # 捕获 default 值(排除逗号和括号)
215
+ r')?' # 可选参数组
216
+ r'\s*\)', # 闭合括号
217
+ re.DOTALL
216
218
  ) # yapf: disable
217
219
 
218
220
  def replacement(match):
219
221
  quote = match.group(1)
220
222
  var_name = match.group(2)
221
- extra_args = match.group(3)
223
+ default_value = match.group(3)
224
+
222
225
  base = f'__VAR_{hash_str}'
223
- if extra_args is not None:
224
- return f'{base}.get({quote}{var_name}{quote}, {extra_args})'
226
+ if default_value is not None:
227
+ # 清除 default 值前后的空格
228
+ clean_value = default_value.strip()
229
+ return f'{base}.get({quote}{var_name}{quote}, {clean_value})'
225
230
  else:
226
231
  return f'{base}[{quote}{var_name}{quote}]'
227
232
 
Binary file
qulab/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.9.1"
1
+ __version__ = "2.9.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QuLab
3
- Version: 2.9.1
3
+ Version: 2.9.2
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,10 +1,10 @@
1
1
  qulab/__init__.py,sha256=JZ3bn_kTVlnY-P8JXQ5xEdViieFXqfxX8ReLuiiXIpo,321
2
2
  qulab/__main__.py,sha256=fjaRSL_uUjNIzBGNgjlGswb9TJ2VD5qnkZHW3hItrD4,68
3
3
  qulab/dicttree.py,sha256=tRRMpGZYVOLw0TEByE3_2Ss8FdOmzuGL9e1DWbs8qoY,13684
4
- qulab/fun.cpython-310-darwin.so,sha256=XaVIzvy6feXdcVgE-Dm9oUk-E397WYDfcNOx9dCldSg,126864
4
+ qulab/fun.cpython-310-darwin.so,sha256=KkX_WfWmjrkzMTFlmg5iSjCwIC8m_JP3AxRuk6ncYMs,126864
5
5
  qulab/typing.py,sha256=vg62sGqxuD9CI5677ejlzAmf2fVdAESZCQjAE_xSxPg,69
6
6
  qulab/utils.py,sha256=BdLdlfjpe6m6gSeONYmpAKTTqxDaYHNk4exlz8kZxTg,2982
7
- qulab/version.py,sha256=PI0CClL_hygeEn74dTBxg_JTTS5dp_WnkPKZJhTgaAo,21
7
+ qulab/version.py,sha256=JvlWgPzoYT0e0o9kpkkX-auu312YIKFUMfS8Fb-i9gM,21
8
8
  qulab/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  qulab/cli/commands.py,sha256=tgDIkkeIoasQXAifJZ6NU8jDgpNgb2a-B0C4nF0evrE,559
10
10
  qulab/cli/config.py,sha256=Ei7eSYnbwPPlluDnm8YmWONYiI4g7WtvlZGQdr1Z6vo,3688
@@ -13,7 +13,7 @@ qulab/executor/cli.py,sha256=8d-8bRWZ5lmsMtjASsl1zu1rV-syeAESMNVthvIQxlo,10018
13
13
  qulab/executor/load.py,sha256=zWofQqHujDyS6HykKEj3fytazA2qEGmB2ZF3OPScSFY,17566
14
14
  qulab/executor/schedule.py,sha256=0BV5LGxhqdIlGwW6-o5_5mljAtdtL1La8EDNBFi8pzU,18585
15
15
  qulab/executor/storage.py,sha256=OA_XMDoFDfPZCU89caf9-VZ3D6qaWib8MpJno10KUfc,20770
16
- qulab/executor/template.py,sha256=BhNP8GrTk0pCK3GwijI08Q2jmYPbLi_7A5XWZXhCtUo,10123
16
+ qulab/executor/template.py,sha256=WPuHQ_1dpRIM4d9k0VDA-LVJaVDI2GXt26kdQ0rNQPk,10370
17
17
  qulab/executor/transform.py,sha256=BDx0c4nqTHMAOLVqju0Ydd91uxNm6EpVIfssjZse0bI,2284
18
18
  qulab/executor/utils.py,sha256=l_b0y2kMwYKyyXeFtoblPYwKNU-wiFQ9PMo9QlWl9wE,6213
19
19
  qulab/monitor/__init__.py,sha256=nTHelnDpxRS_fl_B38TsN0njgq8eVTEz9IAnN3NbDlM,42
@@ -97,9 +97,9 @@ qulab/visualization/plot_seq.py,sha256=UWTS6p9nfX_7B8ehcYo6UnSTUCjkBsNU9jiOeW2ca
97
97
  qulab/visualization/qdat.py,sha256=ZeevBYWkzbww4xZnsjHhw7wRorJCBzbG0iEu-XQB4EA,5735
98
98
  qulab/visualization/rot3d.py,sha256=lMrEJlRLwYe6NMBlGkKYpp_V9CTipOAuDy6QW_cQK00,734
99
99
  qulab/visualization/widgets.py,sha256=6KkiTyQ8J-ei70LbPQZAK35wjktY47w2IveOa682ftA,3180
100
- qulab-2.9.1.dist-info/licenses/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
101
- qulab-2.9.1.dist-info/METADATA,sha256=_cdzTIx-TpGTVj94TqmLcwMapxPz0LVn4DNAZoJw2ZU,3720
102
- qulab-2.9.1.dist-info/WHEEL,sha256=qnIvK8L8kOW9FTrzifubcmNsZckgNfGDNKzGG7FMEdE,114
103
- qulab-2.9.1.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
104
- qulab-2.9.1.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
105
- qulab-2.9.1.dist-info/RECORD,,
100
+ qulab-2.9.2.dist-info/licenses/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
101
+ qulab-2.9.2.dist-info/METADATA,sha256=x0_lfhLW3JM78GEYukvUCr-eKs2XsRf_gT7at651x8E,3720
102
+ qulab-2.9.2.dist-info/WHEEL,sha256=qnIvK8L8kOW9FTrzifubcmNsZckgNfGDNKzGG7FMEdE,114
103
+ qulab-2.9.2.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
104
+ qulab-2.9.2.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
105
+ qulab-2.9.2.dist-info/RECORD,,
File without changes