-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
78 lines (67 loc) · 2.87 KB
/
Copy pathsetup.py
File metadata and controls
78 lines (67 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import os
import sys
from setuptools import setup
# --- Project scaffold configuration -----------------------------------------
PROJECT_STRUCTURE = {
"data_streams": ["synthetic_stream.py"],
"entropy_core": ["entropy_engine.py"],
"frames": ["eeframe_generator.py"],
"visualization": ["display_3d.py"],
"sandbox": ["strategy_plugins.py"],
"": ["run.py", "README.md", "requirements.txt"],
}
DEFAULT_REQUIREMENTS = """numpy\nscipy\nmatplotlib\n"""
DEFAULT_README = (
"# Entropy Aquarium\n\n"
"A live entropy visualization sandbox and demonstrator with real-time telemetry "
"stream input, 3D entropy arrow display, and strategy prototyping features.\n"
)
def _write_text(path: str, text: str) -> None:
os.makedirs(os.path.dirname(path) or ".", exist_ok=True)
with open(path, "w", encoding="utf-8", newline="\n") as f:
f.write(text)
def create_project_structure(base_dir: str = ".") -> None:
"""Create the initial folder/file scaffold. Safe to re-run (idempotent)."""
created = []
for folder, files in PROJECT_STRUCTURE.items():
target_dir = os.path.join(base_dir, folder) if folder else base_dir
if folder and not os.path.exists(target_dir):
os.makedirs(target_dir, exist_ok=True)
created.append(f"dir: {target_dir}")
for filename in files:
full_path = os.path.join(target_dir, filename)
if not os.path.exists(full_path):
if filename == "requirements.txt":
_write_text(full_path, DEFAULT_REQUIREMENTS)
elif filename == "README.md":
_write_text(full_path, DEFAULT_README)
else:
stub = (
f"# {filename}\n\n"
"\"\"\"\n"
"Stub created by setup.py scaffold. Replace with implementation.\n"
"\"\"\"\n"
)
_write_text(full_path, stub)
created.append(f"file: {full_path}")
if created:
print("Scaffold created:")
for item in created:
print(" -", item)
else:
print("Scaffold already present; nothing to create.")
if __name__ == "__main__":
# When invoked directly (e.g., `python setup.py`), always run the scaffold.
create_project_structure()
# If setuptools commands are provided (e.g., develop/sdist/bdist_wheel), run setup().
if len(sys.argv) > 1 and sys.argv[1] not in ("-c",):
setup(
name="entropy-aquarium",
version="0.1.0",
description="Entropy visualization sandbox and prototyping tool",
author="henry-pozzetta",
packages=[], # to be populated once modules are packaged
install_requires=["numpy", "scipy", "matplotlib"],
include_package_data=True,
zip_safe=False,
)