QuLab 2.9.9__cp312-cp312-win_amd64.whl → 2.9.10__cp312-cp312-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 CHANGED
@@ -1,7 +1,7 @@
1
- import graphlib
1
+ import atexit
2
2
  import inspect
3
3
  import pickle
4
- import sys
4
+ import tempfile
5
5
  import warnings
6
6
  from importlib.util import module_from_spec, spec_from_file_location
7
7
  from pathlib import Path
@@ -333,17 +333,18 @@ def load_workflow_from_file(file_name: str,
333
333
  def load_workflow_from_source_code(workflow_id: str,
334
334
  source_code: str,
335
335
  package='workflows') -> WorkflowType:
336
- path = Path(workflow_id)
337
- module_name = f"{package}.{'.'.join([*path.parts[:-1], path.stem])}"
336
+ workflow_path = Path(workflow_id)
337
+ module_name = f"{package}.{'.'.join([*workflow_path.parts[:-1], workflow_path.stem])}"
338
+
339
+ temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.py').name
340
+ with open(temp_file, 'w') as f:
341
+ f.write(source_code)
342
+
343
+ atexit.register(lambda f=temp_file: Path(f).unlink(missing_ok=True))
338
344
 
339
- # 创建一个新的模块对象
340
- module = ModuleType(module_name)
341
- # 将模块注册到sys.modules中
342
- sys.modules[module_name] = module
343
- # 将源代码编译成字节码
344
- code = compile(source_code, '<string>', 'exec')
345
- # 在模块的命名空间中执行字节码
346
- exec(code, module.__dict__)
345
+ spec = spec_from_file_location(module_name, temp_file)
346
+ module = module_from_spec(spec)
347
+ spec.loader.exec_module(module)
347
348
 
348
349
  module.__source__ = source_code
349
350
  module.__mtime__ = 0
Binary file
qulab/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.9.9"
1
+ __version__ = "2.9.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: QuLab
3
- Version: 2.9.9
3
+ Version: 2.9.10
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,17 +1,17 @@
1
1
  qulab/__init__.py,sha256=ulapyzt9DsDgT68EEbzuhniofHb512pNTFc-Sxfrr8Y,375
2
2
  qulab/__main__.py,sha256=FL4YsGZL1jEtmcPc5WbleArzhOHLMsWl7OH3O-1d1ss,72
3
3
  qulab/dicttree.py,sha256=ZoSJVWK4VMqfzj42gPb_n5RqLlM6K1Me0WmLIfLEYf8,14195
4
- qulab/fun.cp312-win_amd64.pyd,sha256=0qVm2aOk9QdRNjF-fATe5A-csnsTNafYyW8Ym15HfTw,32256
4
+ qulab/fun.cp312-win_amd64.pyd,sha256=mMVPZSf8qhLMT74P0qQjXTCevH-lWfO-ylgaYoLMvE0,32256
5
5
  qulab/typing.py,sha256=PRtwbCHWY2ROKK8GHq4Bo8llXrIGo6xC73DrQf7S9os,71
6
6
  qulab/utils.py,sha256=65N2Xj7kqRsQ4epoLNY6tL-i5ts6Wk8YuJYee3Te6zI,3077
7
- qulab/version.py,sha256=gB2GONub0WyICh4-SbXI8ce5oNADu2_gH_-ZqWOveM0,21
7
+ qulab/version.py,sha256=ibM5yQ1vwSBgdRVCwiRzSGyWXnuL47O8ktNp4dWQPKM,22
8
8
  qulab/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  qulab/cli/commands.py,sha256=ZTs32yQjvwPIsFjXYWNr4KqEvly0NISIqyh--96qCAY,627
10
10
  qulab/cli/config.py,sha256=7h3k0K8FYHhI6LVWt8BoDdKrX2ApFDBAUAUuXhHwst4,3799
11
11
  qulab/executor/__init__.py,sha256=LosPzOMaljSZY1thy_Fxtbrgq7uubJszMABEB7oM7tU,101
12
12
  qulab/executor/analyze.py,sha256=VoSthE2RTarY6Wj3QFKh4FqReMYL7djSAyuitgHs5K0,5837
13
13
  qulab/executor/cli.py,sha256=xceK6XNLnNpAVtqvs0_wOAuG0sgS9jg1iTFYmxVUMWY,11795
14
- qulab/executor/load.py,sha256=qI-3b3xvsjZMCthRO3hlzHA0BZI-tH9Y_L0XLBcyWV8,18657
14
+ qulab/executor/load.py,sha256=6QLlATu2KyGY2nrWLFTVxDE4DwoCXx3WNx72QR_LZB0,18715
15
15
  qulab/executor/schedule.py,sha256=XRimchHYCgnMAOtCvNLjwMv9IkcTAyBAUCHKQs5RBRw,18745
16
16
  qulab/executor/storage.py,sha256=8K73KGLAVgchJdtd4rKHXkr1CQOJORWH-Gi57w8IYsw,21081
17
17
  qulab/executor/template.py,sha256=dKQM3IlADdTi9qp0fnOYjyycRNEl7KeSCBZhwbmP8bQ,10828
@@ -98,9 +98,9 @@ qulab/visualization/plot_seq.py,sha256=Uo1-dB1YE9IN_A9tuaOs9ZG3S5dKDQ_l98iD2Wbxp
98
98
  qulab/visualization/qdat.py,sha256=HubXFu4nfcA7iUzghJGle1C86G6221hicLR0b-GqhKQ,5887
99
99
  qulab/visualization/rot3d.py,sha256=jGHJcqj1lEWBUV-W4GUGONGacqjrYvuFoFCwPse5h1Y,757
100
100
  qulab/visualization/widgets.py,sha256=HcYwdhDtLreJiYaZuN3LfofjJmZcLwjMfP5aasebgDo,3266
101
- qulab-2.9.9.dist-info/licenses/LICENSE,sha256=b4NRQ-GFVpJMT7RuExW3NwhfbrYsX7AcdB7Gudok-fs,1086
102
- qulab-2.9.9.dist-info/METADATA,sha256=UyXZQG4kRUuwLlEQLdRW06Ww-XIwahMxJ9c2V3Jk8es,3859
103
- qulab-2.9.9.dist-info/WHEEL,sha256=ovhA9_Ei_7ok2fAych90j-feDV4goiAxbO7REePtvw0,101
104
- qulab-2.9.9.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
105
- qulab-2.9.9.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
106
- qulab-2.9.9.dist-info/RECORD,,
101
+ qulab-2.9.10.dist-info/licenses/LICENSE,sha256=b4NRQ-GFVpJMT7RuExW3NwhfbrYsX7AcdB7Gudok-fs,1086
102
+ qulab-2.9.10.dist-info/METADATA,sha256=ReIeAeedz-ZeTH2tZkFNk-mkewmmmKa0f2DrrbT3oJg,3860
103
+ qulab-2.9.10.dist-info/WHEEL,sha256=ovhA9_Ei_7ok2fAych90j-feDV4goiAxbO7REePtvw0,101
104
+ qulab-2.9.10.dist-info/entry_points.txt,sha256=b0v1GXOwmxY-nCCsPN_rHZZvY9CtTbWqrGj8u1m8yHo,45
105
+ qulab-2.9.10.dist-info/top_level.txt,sha256=3T886LbAsbvjonu_TDdmgxKYUn939BVTRPxPl9r4cEg,6
106
+ qulab-2.9.10.dist-info/RECORD,,
File without changes