RemiFabre commited on
Commit
431d0b3
Β·
1 Parent(s): 5f38209

Add convenience launcher script

Browse files
Files changed (2) hide show
  1. Theremini/main.py +2 -11
  2. main.py +6 -0
Theremini/main.py CHANGED
@@ -12,17 +12,8 @@ from reachy_mini.utils import create_head_pose
12
  from scamp import Session
13
  from scipy.spatial.transform import Rotation as R
14
 
15
- if __package__ in (None, ""):
16
- # Allow running as a standalone script (python main.py) by exposing package root.
17
- import sys
18
- from pathlib import Path
19
-
20
- sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
21
- from Theremini.config import get_active_instruments
22
- from Theremini.dashboard import DASHBOARD_PORT, DashboardServer, set_status
23
- else:
24
- from .config import get_active_instruments
25
- from .dashboard import DASHBOARD_PORT, DashboardServer, set_status
26
 
27
  # ────────────────── mapping constants ───────────────────────────────
28
  ROLL_DEG_RANGE = (-60, 60) # head roll span
 
12
  from scamp import Session
13
  from scipy.spatial.transform import Rotation as R
14
 
15
+ from .config import get_active_instruments
16
+ from .dashboard import DASHBOARD_PORT, DashboardServer, set_status
 
 
 
 
 
 
 
 
 
17
 
18
  # ────────────────── mapping constants ───────────────────────────────
19
  ROLL_DEG_RANGE = (-60, 60) # head roll span
main.py ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ """Convenience launcher so `python main.py` behaves like `python -m Theremini.main`."""
2
+
3
+ from runpy import run_module
4
+
5
+ if __name__ == "__main__":
6
+ run_module("Theremini.main", run_name="__main__")