QuLab 2.7.14__cp312-cp312-macosx_10_13_universal2.whl → 2.7.15__cp312-cp312-macosx_10_13_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.
- qulab/executor/template.py +15 -2
- qulab/fun.cpython-312-darwin.so +0 -0
- qulab/version.py +1 -1
- {qulab-2.7.14.dist-info → qulab-2.7.15.dist-info}/METADATA +1 -1
- {qulab-2.7.14.dist-info → qulab-2.7.15.dist-info}/RECORD +9 -9
- {qulab-2.7.14.dist-info → qulab-2.7.15.dist-info}/LICENSE +0 -0
- {qulab-2.7.14.dist-info → qulab-2.7.15.dist-info}/WHEEL +0 -0
- {qulab-2.7.14.dist-info → qulab-2.7.15.dist-info}/entry_points.txt +0 -0
- {qulab-2.7.14.dist-info → qulab-2.7.15.dist-info}/top_level.txt +0 -0
qulab/executor/template.py
CHANGED
@@ -121,7 +121,10 @@ def inject_mapping(source: str, mapping: dict[str, Any],
|
|
121
121
|
hash_str, mapping_code = encode_mapping(mapping)
|
122
122
|
|
123
123
|
tree = ast.parse(source)
|
124
|
+
|
124
125
|
lines = source.splitlines()
|
126
|
+
lines_offset = [0 for _ in range(len(lines))]
|
127
|
+
|
125
128
|
extractor = TemplateVarExtractor(fname, mapping)
|
126
129
|
extractor.visit(tree)
|
127
130
|
|
@@ -134,8 +137,10 @@ def inject_mapping(source: str, mapping: dict[str, Any],
|
|
134
137
|
for (lineno, end_lineno, col_offset,
|
135
138
|
end_col_offset), (kind, name, old_source,
|
136
139
|
new_source) in extractor.replacements.items():
|
137
|
-
head = lines[lineno - 1][:col_offset]
|
138
|
-
tail = lines[end_lineno - 1][end_col_offset
|
140
|
+
head = lines[lineno - 1][:col_offset + lines_offset[lineno - 1]]
|
141
|
+
tail = lines[end_lineno - 1][end_col_offset +
|
142
|
+
lines_offset[end_lineno - 1]:]
|
143
|
+
length_of_last_line = len(lines[end_lineno - 1])
|
139
144
|
content = lines[lineno - 1:end_lineno]
|
140
145
|
content[0] = content[0].removeprefix(head)
|
141
146
|
content[-1] = content[-1].removesuffix(tail)
|
@@ -148,8 +153,12 @@ def inject_mapping(source: str, mapping: dict[str, Any],
|
|
148
153
|
formated_lines[-1] = formated_lines[-1] + tail
|
149
154
|
if len(formated_lines) == 1:
|
150
155
|
lines[lineno - 1] = formated_lines[0]
|
156
|
+
lines_offset[lineno -
|
157
|
+
1] += len(lines[lineno - 1]) - length_of_last_line
|
151
158
|
else:
|
152
159
|
lines[lineno - 1:end_lineno] = formated_lines
|
160
|
+
lines_offset[end_lineno - 1] += len(
|
161
|
+
lines[end_lineno - 1]) - length_of_last_line
|
153
162
|
else:
|
154
163
|
pattern = re.compile(r'VAR\s*\(\s*(["\'])(\w+)\1\s*\)')
|
155
164
|
replacement = f'__VAR_{hash_str}' + r'[\1\2\1]'
|
@@ -157,11 +166,15 @@ def inject_mapping(source: str, mapping: dict[str, Any],
|
|
157
166
|
|
158
167
|
if lineno == end_lineno:
|
159
168
|
lines[lineno - 1] = head + new_content + tail
|
169
|
+
lines_offset[lineno -
|
170
|
+
1] += len(lines[lineno - 1]) - length_of_last_line
|
160
171
|
else:
|
161
172
|
lines[lineno - 1] = head + new_content[:-1]
|
162
173
|
for i in range(lineno, end_lineno - 1):
|
163
174
|
lines[i] = ''
|
164
175
|
lines[end_lineno - 1] = ']' + tail
|
176
|
+
lines_offset[end_lineno - 1] += len(
|
177
|
+
lines[end_lineno - 1]) - length_of_last_line
|
165
178
|
|
166
179
|
injected_code = '\n'.join([
|
167
180
|
f"__QULAB_TEMPLATE__ = \"{fname}\"",
|
qulab/fun.cpython-312-darwin.so
CHANGED
Binary file
|
qulab/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "2.7.
|
1
|
+
__version__ = "2.7.15"
|
@@ -1,10 +1,10 @@
|
|
1
1
|
qulab/__init__.py,sha256=KJcUcZ5qXY6wlAoirzK_B-dgtDjsLmOE671v3gcXO_c,286
|
2
2
|
qulab/__main__.py,sha256=fjaRSL_uUjNIzBGNgjlGswb9TJ2VD5qnkZHW3hItrD4,68
|
3
3
|
qulab/dicttree.py,sha256=tRRMpGZYVOLw0TEByE3_2Ss8FdOmzuGL9e1DWbs8qoY,13684
|
4
|
-
qulab/fun.cpython-312-darwin.so,sha256=
|
4
|
+
qulab/fun.cpython-312-darwin.so,sha256=bailttV5K7OqtKNYvd4z1px1ky3nzYQ2c8WFDJseDZw,126864
|
5
5
|
qulab/typing.py,sha256=vg62sGqxuD9CI5677ejlzAmf2fVdAESZCQjAE_xSxPg,69
|
6
6
|
qulab/utils.py,sha256=JIXMSmZU0uYfKG_tzawpK7vRNPRir_hJE8JlqkVLX2o,1260
|
7
|
-
qulab/version.py,sha256
|
7
|
+
qulab/version.py,sha256=-hKvJfKSrJwPY8gXyRBQzkjU0b1wKGMX2qCqb_6ZsJU,22
|
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=z8W1RivKdABQSOGy2viNUvG73QvOBpE9gSKjw45vSVA,9794
|
|
13
13
|
qulab/executor/load.py,sha256=_Zn4wtGGD8pBZwOfbJaaFVAr8riY2Bkhi67lX9Jy-hA,17427
|
14
14
|
qulab/executor/schedule.py,sha256=9pTOVWzKiDc7ip8iuB_47poJcYOvoBI9eQwTrDTA3p0,19044
|
15
15
|
qulab/executor/storage.py,sha256=gI6g28BmKKEZ_Pl-hFwvpiOj3mF8Su-yjj3hfMXs1VY,11630
|
16
|
-
qulab/executor/template.py,sha256=
|
16
|
+
qulab/executor/template.py,sha256=1c7xd0U82fLaqb8O0NQIVVd7aRLuCZNT11-heFw2n9Q,7540
|
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.7.
|
101
|
-
qulab-2.7.
|
102
|
-
qulab-2.7.
|
103
|
-
qulab-2.7.
|
104
|
-
qulab-2.7.
|
105
|
-
qulab-2.7.
|
100
|
+
qulab-2.7.15.dist-info/LICENSE,sha256=PRzIKxZtpQcH7whTG6Egvzl1A0BvnSf30tmR2X2KrpA,1065
|
101
|
+
qulab-2.7.15.dist-info/METADATA,sha256=qV-NFza6lghhNhFqpPouQzNyYQLlVm-8VPdc5oxZHAw,3699
|
102
|
+
qulab-2.7.15.dist-info/WHEEL,sha256=fFOVbjuXq1Laa94sCGPI7Uf9zA1mmgTMmAoKgZIw_cY,115
|
103
|
+
qulab-2.7.15.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
|
104
|
+
qulab-2.7.15.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
|
105
|
+
qulab-2.7.15.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|