update plot to force units
This commit is contained in:
@@ -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__":
|
||||
|
||||
Reference in New Issue
Block a user