q8s 0.14.0.dev0__tar.gz → 0.14.0.dev1__tar.gz

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.
Files changed (46) hide show
  1. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/PKG-INFO +3 -2
  2. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/pyproject.toml +3 -2
  3. q8s-0.14.0.dev1/src/q8s/runtime/__init__.py +0 -0
  4. q8s-0.14.0.dev1/src/q8s/runtime/decorators.py +51 -0
  5. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s.egg-info/PKG-INFO +3 -2
  6. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s.egg-info/SOURCES.txt +2 -0
  7. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s.egg-info/requires.txt +1 -0
  8. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/LICENSE +0 -0
  9. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/README.md +0 -0
  10. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/setup.cfg +0 -0
  11. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/__init__.py +0 -0
  12. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/__main__.py +0 -0
  13. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/bakefile.py +0 -0
  14. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/cli.py +0 -0
  15. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/constants.py +0 -0
  16. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/enums.py +0 -0
  17. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/execution.py +0 -0
  18. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/install.py +0 -0
  19. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/kernel.py +0 -0
  20. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/matplotlib/backend.py +0 -0
  21. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/multifiles.py +0 -0
  22. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/plugins/__init__.py +0 -0
  23. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/plugins/cpu_job.py +0 -0
  24. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/plugins/cuda_job.py +0 -0
  25. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/plugins/job.py +0 -0
  26. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/plugins/job_template_spec.py +0 -0
  27. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/plugins/utils/__init__.py +0 -0
  28. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/plugins/utils/git_info.py +0 -0
  29. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/project.py +0 -0
  30. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/utils.py +0 -0
  31. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s/workload.py +0 -0
  32. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s.egg-info/dependency_links.txt +0 -0
  33. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s.egg-info/entry_points.txt +0 -0
  34. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/src/q8s.egg-info/top_level.txt +0 -0
  35. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_backend.py +0 -0
  36. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_bakefile.py +0 -0
  37. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_constants.py +0 -0
  38. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_execution.py +0 -0
  39. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_git_info.py +0 -0
  40. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_job_plugin.py +0 -0
  41. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_job_template_spec.py +0 -0
  42. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_kernel.py +0 -0
  43. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_multifiles.py +0 -0
  44. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_project.py +0 -0
  45. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_utils.py +0 -0
  46. {q8s-0.14.0.dev0 → q8s-0.14.0.dev1}/tests/test_workload.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: q8s
3
- Version: 0.14.0.dev0
4
- Summary: Kernel extension for executing quantum programs in simulators on q8s clusters
3
+ Version: 0.14.0.dev1
4
+ Summary: CLI and Jupyter kernel extension for executing quantum programs in simulators on Kubernetes clusters
5
5
  Author-email: Vlad Stirbu <vstirbu@gmail.com>
6
6
  License: Apache License
7
7
  Version 2.0, January 2004
@@ -231,6 +231,7 @@ Requires-Dist: typer>=0.15.4
231
231
  Requires-Dist: GitPython>=3.1.43
232
232
  Requires-Dist: python-dxf>=12.1.1
233
233
  Requires-Dist: hydra-core>=1.2.0
234
+ Requires-Dist: omegaconf
234
235
  Provides-Extra: benchmark
235
236
  Requires-Dist: pandas; extra == "benchmark"
236
237
  Requires-Dist: testbook; extra == "benchmark"
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  name = "q8s"
3
- version = "0.14.0-dev0"
4
- description = "Kernel extension for executing quantum programs in simulators on q8s clusters"
3
+ version = "0.14.0-dev1"
4
+ description = "CLI and Jupyter kernel extension for executing quantum programs in simulators on Kubernetes clusters"
5
5
  authors = [{ name = "Vlad Stirbu", email = "vstirbu@gmail.com" }]
6
6
  readme = "README.md"
7
7
  license = { file = "LICENSE" }
@@ -29,6 +29,7 @@ dependencies = [
29
29
  "GitPython>=3.1.43",
30
30
  "python-dxf>=12.1.1",
31
31
  "hydra-core>=1.2.0",
32
+ "omegaconf",
32
33
  ]
33
34
  requires-python = ">= 3.10"
34
35
 
File without changes
@@ -0,0 +1,51 @@
1
+ import base64
2
+ import sys
3
+ import traceback
4
+ from dataclasses import is_dataclass
5
+ from functools import wraps
6
+ from typing import Type, TypeVar
7
+
8
+ from omegaconf import OmegaConf
9
+
10
+ T = TypeVar("T")
11
+
12
+
13
+ def with_app_config(config_cls: Type[T]):
14
+ """
15
+ Decorator that:
16
+ - reads base64-encoded config from sys.argv[1]
17
+ - merges it with a structured OmegaConf dataclass
18
+ - resolves the config
19
+ - passes the config instance into the function
20
+ """
21
+
22
+ if not is_dataclass(config_cls):
23
+ raise TypeError("config_cls must be a dataclass")
24
+
25
+ def decorator(func):
26
+ @wraps(func)
27
+ def wrapper(*args, **kwargs):
28
+ cfg = None
29
+ trace: str = None
30
+
31
+ if len(sys.argv) < 2:
32
+ raise RuntimeError(
33
+ "Missing base64-encoded config argument (expected sys.argv[1])"
34
+ )
35
+
36
+ try:
37
+ raw_input = base64.b64decode(sys.argv[1]).decode("utf-8")
38
+
39
+ cfg = OmegaConf.merge(
40
+ OmegaConf.structured(config_cls),
41
+ OmegaConf.create(raw_input),
42
+ )
43
+ OmegaConf.resolve(cfg)
44
+ except Exception:
45
+ trace = traceback.format_exc()
46
+
47
+ return func(cfg, trace, *args, **kwargs)
48
+
49
+ return wrapper
50
+
51
+ return decorator
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: q8s
3
- Version: 0.14.0.dev0
4
- Summary: Kernel extension for executing quantum programs in simulators on q8s clusters
3
+ Version: 0.14.0.dev1
4
+ Summary: CLI and Jupyter kernel extension for executing quantum programs in simulators on Kubernetes clusters
5
5
  Author-email: Vlad Stirbu <vstirbu@gmail.com>
6
6
  License: Apache License
7
7
  Version 2.0, January 2004
@@ -231,6 +231,7 @@ Requires-Dist: typer>=0.15.4
231
231
  Requires-Dist: GitPython>=3.1.43
232
232
  Requires-Dist: python-dxf>=12.1.1
233
233
  Requires-Dist: hydra-core>=1.2.0
234
+ Requires-Dist: omegaconf
234
235
  Provides-Extra: benchmark
235
236
  Requires-Dist: pandas; extra == "benchmark"
236
237
  Requires-Dist: testbook; extra == "benchmark"
@@ -28,6 +28,8 @@ src/q8s/plugins/job.py
28
28
  src/q8s/plugins/job_template_spec.py
29
29
  src/q8s/plugins/utils/__init__.py
30
30
  src/q8s/plugins/utils/git_info.py
31
+ src/q8s/runtime/__init__.py
32
+ src/q8s/runtime/decorators.py
31
33
  tests/test_backend.py
32
34
  tests/test_bakefile.py
33
35
  tests/test_constants.py
@@ -9,6 +9,7 @@ typer>=0.15.4
9
9
  GitPython>=3.1.43
10
10
  python-dxf>=12.1.1
11
11
  hydra-core>=1.2.0
12
+ omegaconf
12
13
 
13
14
  [benchmark]
14
15
  pandas
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes