tokenomics 0.5.1__py3-none-any.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.
- tokenomics/__init__.py +1 -0
- tokenomics/__main__.py +3 -0
- tokenomics/cli.py +35 -0
- tokenomics/completion_benchmark.py +744 -0
- tokenomics/embedding_benchmark.py +463 -0
- tokenomics/io.py +98 -0
- tokenomics/plot_completion_benchmark.py +515 -0
- tokenomics/plot_embedding_benchmark.py +299 -0
- tokenomics/sampling/__init__.py +23 -0
- tokenomics/sampling/dataset.py +147 -0
- tokenomics/sampling/sampler.py +93 -0
- tokenomics/sampling/scenarios.py +190 -0
- tokenomics-0.5.1.dist-info/METADATA +130 -0
- tokenomics-0.5.1.dist-info/RECORD +17 -0
- tokenomics-0.5.1.dist-info/WHEEL +4 -0
- tokenomics-0.5.1.dist-info/entry_points.txt +2 -0
- tokenomics-0.5.1.dist-info/licenses/LICENSE +21 -0
tokenomics/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.5.1"
|
tokenomics/__main__.py
ADDED
tokenomics/cli.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Thin CLI dispatcher for tokenomics subcommands."""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
SUBCOMMANDS = {
|
|
7
|
+
"completion": ("tokenomics.completion_benchmark", "main"),
|
|
8
|
+
"embedding": ("tokenomics.embedding_benchmark", "main"),
|
|
9
|
+
"plot-completion": ("tokenomics.plot_completion_benchmark", "main"),
|
|
10
|
+
"plot-embedding": ("tokenomics.plot_embedding_benchmark", "main"),
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def main():
|
|
15
|
+
if len(sys.argv) < 2 or sys.argv[1] in ("-h", "--help"):
|
|
16
|
+
print("usage: tokenomics <subcommand> [args ...]\n")
|
|
17
|
+
print("subcommands:")
|
|
18
|
+
for name in SUBCOMMANDS:
|
|
19
|
+
print(f" {name}")
|
|
20
|
+
print("\nRun 'tokenomics <subcommand> --help' for subcommand help.")
|
|
21
|
+
sys.exit(0)
|
|
22
|
+
|
|
23
|
+
name = sys.argv[1]
|
|
24
|
+
if name not in SUBCOMMANDS:
|
|
25
|
+
print(f"error: unknown subcommand '{name}'")
|
|
26
|
+
print(f"available: {', '.join(SUBCOMMANDS)}")
|
|
27
|
+
sys.exit(1)
|
|
28
|
+
|
|
29
|
+
# Strip the subcommand from argv so argparse in each module sees the right args
|
|
30
|
+
sys.argv = [f"tokenomics {name}"] + sys.argv[2:]
|
|
31
|
+
|
|
32
|
+
module_path, func_name = SUBCOMMANDS[name]
|
|
33
|
+
from importlib import import_module
|
|
34
|
+
mod = import_module(module_path)
|
|
35
|
+
getattr(mod, func_name)()
|