update plot to force units

This commit is contained in:
ykcheungab
2026-09-01 16:24:12 +08:00
parent 8cacb12abc
commit e7789c86cb
31 changed files with 767 additions and 77 deletions
+36 -2
View File
@@ -1,4 +1,4 @@
"""Copy Orisys wheel sensor JSON configs into repo config/ (exclude options.json)."""
"""Copy Orisys wheel sensor JSON configs and sensors/ bundles into the repo."""
from __future__ import annotations
@@ -17,6 +17,16 @@ def wheel_config_dir() -> Path:
return inner_pkg.parent / "configs"
def wheel_sensors_dir() -> Path | None:
import orisys
inner_pkg = Path(orisys.__file__).resolve().parent
for candidate in (inner_pkg / "sensors", inner_pkg.parent / "sensors"):
if candidate.is_dir() and any(candidate.iterdir()):
return candidate
return None
def sync_configs(repo_root: Path) -> int:
src = wheel_config_dir()
if not src.is_dir():
@@ -37,9 +47,33 @@ def sync_configs(repo_root: Path) -> int:
return 0
def sync_sensor_bundles(repo_root: Path) -> int:
src = wheel_sensors_dir()
if src is None or not src.is_dir():
print("Orisys wheel sensors/ directory not found; skipping bundle sync")
return 0
dst = repo_root / "sensors"
dst.mkdir(parents=True, exist_ok=True)
copied = 0
for bundle_dir in sorted(p for p in src.iterdir() if p.is_dir()):
target = dst / bundle_dir.name
if target.exists():
shutil.rmtree(target)
shutil.copytree(bundle_dir, target)
copied += 1
print(f"Synced {copied} sensor bundle(s) from {src} to {dst}")
return 0
def main() -> int:
repo_root = Path(__file__).resolve().parents[1]
return sync_configs(repo_root)
code = sync_configs(repo_root)
if code != 0:
return code
return sync_sensor_bundles(repo_root)
if __name__ == "__main__":