QuLab 2.9.0__cp311-cp311-win_amd64.whl → 2.9.2__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.
- qulab/executor/load.py +2 -1
- qulab/executor/template.py +13 -8
- qulab/fun.cp311-win_amd64.pyd +0 -0
- qulab/version.py +1 -1
- {qulab-2.9.0.dist-info → qulab-2.9.2.dist-info}/METADATA +1 -1
- {qulab-2.9.0.dist-info → qulab-2.9.2.dist-info}/RECORD +10 -10
- {qulab-2.9.0.dist-info → qulab-2.9.2.dist-info}/WHEEL +1 -1
- {qulab-2.9.0.dist-info → qulab-2.9.2.dist-info}/entry_points.txt +0 -0
- {qulab-2.9.0.dist-info → qulab-2.9.2.dist-info}/licenses/LICENSE +0 -0
- {qulab-2.9.0.dist-info → qulab-2.9.2.dist-info}/top_level.txt +0 -0
qulab/executor/load.py
CHANGED
@@ -357,7 +357,8 @@ def load_workflow_from_template(template_path: str,
|
|
357
357
|
path = target_path
|
358
358
|
|
359
359
|
file = base_path / path
|
360
|
-
if not file.exists() or file.stat().st_mtime < mtime
|
360
|
+
if not file.exists() or (file.stat().st_mtime < mtime
|
361
|
+
and file.read_text() != content):
|
361
362
|
file.parent.mkdir(parents=True, exist_ok=True)
|
362
363
|
with open(file, 'w') as f:
|
363
364
|
f.write(content)
|
qulab/executor/template.py
CHANGED
@@ -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*'
|
212
|
-
r'(["\'])(\w+)\1'
|
213
|
-
r'(?:\s*,\s*
|
214
|
-
r'
|
215
|
-
|
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
|
-
|
223
|
+
default_value = match.group(3)
|
224
|
+
|
222
225
|
base = f'__VAR_{hash_str}'
|
223
|
-
if
|
224
|
-
|
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
|
|
qulab/fun.cp311-win_amd64.pyd
CHANGED
Binary file
|
qulab/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "2.9.
|
1
|
+
__version__ = "2.9.2"
|
@@ -1,19 +1,19 @@
|
|
1
1
|
qulab/__init__.py,sha256=RrWRvG8Lw27zMr7XP8s-z43b09-wiwPi0ZtiNWbky-c,328
|
2
2
|
qulab/__main__.py,sha256=FL4YsGZL1jEtmcPc5WbleArzhOHLMsWl7OH3O-1d1ss,72
|
3
3
|
qulab/dicttree.py,sha256=ZoSJVWK4VMqfzj42gPb_n5RqLlM6K1Me0WmLIfLEYf8,14195
|
4
|
-
qulab/fun.cp311-win_amd64.pyd,sha256=
|
4
|
+
qulab/fun.cp311-win_amd64.pyd,sha256=yOvjp7lZkjDz6HzD8a1RNO9wkXfpHgTepH3zYPdo9G0,31744
|
5
5
|
qulab/typing.py,sha256=PRtwbCHWY2ROKK8GHq4Bo8llXrIGo6xC73DrQf7S9os,71
|
6
6
|
qulab/utils.py,sha256=65N2Xj7kqRsQ4epoLNY6tL-i5ts6Wk8YuJYee3Te6zI,3077
|
7
|
-
qulab/version.py,sha256=
|
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=6xd2eYw32k1NmfAuYSu__1kaP12Oz1QVqwbkYXdWno4,588
|
10
10
|
qulab/cli/config.py,sha256=7h3k0K8FYHhI6LVWt8BoDdKrX2ApFDBAUAUuXhHwst4,3799
|
11
11
|
qulab/executor/__init__.py,sha256=LosPzOMaljSZY1thy_Fxtbrgq7uubJszMABEB7oM7tU,101
|
12
12
|
qulab/executor/cli.py,sha256=8d-8bRWZ5lmsMtjASsl1zu1rV-syeAESMNVthvIQxlo,10018
|
13
|
-
qulab/executor/load.py,sha256=
|
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=
|
16
|
+
qulab/executor/template.py,sha256=nfzhOEjU0O4U0zgUVv-d3h3a5OQ20cbxaK_bZGcV-5Q,10624
|
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=xEVDkJF8issrsDeLqQmDsvtRmrf-UiViFcGTWuzdlFU,43
|
@@ -97,9 +97,9 @@ qulab/visualization/plot_seq.py,sha256=Uo1-dB1YE9IN_A9tuaOs9ZG3S5dKDQ_l98iD2Wbxp
|
|
97
97
|
qulab/visualization/qdat.py,sha256=HubXFu4nfcA7iUzghJGle1C86G6221hicLR0b-GqhKQ,5887
|
98
98
|
qulab/visualization/rot3d.py,sha256=jGHJcqj1lEWBUV-W4GUGONGacqjrYvuFoFCwPse5h1Y,757
|
99
99
|
qulab/visualization/widgets.py,sha256=HcYwdhDtLreJiYaZuN3LfofjJmZcLwjMfP5aasebgDo,3266
|
100
|
-
qulab-2.9.
|
101
|
-
qulab-2.9.
|
102
|
-
qulab-2.9.
|
103
|
-
qulab-2.9.
|
104
|
-
qulab-2.9.
|
105
|
-
qulab-2.9.
|
100
|
+
qulab-2.9.2.dist-info/licenses/LICENSE,sha256=b4NRQ-GFVpJMT7RuExW3NwhfbrYsX7AcdB7Gudok-fs,1086
|
101
|
+
qulab-2.9.2.dist-info/METADATA,sha256=sjOdBs5wJgJXyKevGHdGjBiF02rDH362F2aySXx1IjU,3826
|
102
|
+
qulab-2.9.2.dist-info/WHEEL,sha256=_ZWIY2n7n6SpiuIFl1-RvcMp4Ty36T57FKf-7NzqZHM,101
|
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
|
File without changes
|
File without changes
|