Datasets:
Download code/robohome/src/engine/source/packages/runtime/paths.py from RoboParty/RoboHome: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/datasets/RoboParty/RoboHome/resolve/86ffa4ecc1047bb404fdc283987bd22cbc259a96/code/robohome/src/engine/source/packages/runtime/paths.py
- Command line
-
hf download hf://datasets/RoboParty/RoboHome@86ffa4ecc1047bb404fdc283987bd22cbc259a96/code/robohome/src/engine/source/packages/runtime/paths.py
-
curl -L -o paths.py https://huggingface.co/datasets/RoboParty/RoboHome/resolve/86ffa4ecc1047bb404fdc283987bd22cbc259a96/code/robohome/src/engine/source/packages/runtime/paths.py
1.23 kB
| from __future__ import annotations | |
| import os | |
| from pathlib import Path | |
| PROJECT_ROOT = Path(__file__).resolve().parents[2] | |
| def data_root() -> Path: | |
| """Return the external artifact root; never default inside the code checkout.""" | |
| configured = os.environ.get("RHG_DATA_ROOT") | |
| root = Path(configured).expanduser() if configured else PROJECT_ROOT.parent / "RoboHouseGenData" | |
| return root.resolve() | |
| def runs_root() -> Path: | |
| configured = os.environ.get("RHG_RUNS_ROOT") | |
| root = Path(configured).expanduser() if configured else data_root() / "runs" | |
| return root.resolve() | |
| def api_runs_root() -> Path: | |
| configured = os.environ.get("RHG_RUN_ROOT") | |
| root = Path(configured).expanduser() if configured else runs_root() / "api" | |
| return root.resolve() | |
| def media_root() -> Path: | |
| configured = os.environ.get("RHG_MEDIA_ROOT") | |
| root = Path(configured).expanduser() if configured else data_root() / "media" | |
| return root.resolve() | |
| def resolve_run_path(path: Path) -> Path: | |
| """Map conventional ``runs/...`` paths to the external runs root.""" | |
| if path.is_absolute() or not path.parts or path.parts[0] != "runs": | |
| return path | |
| return runs_root().joinpath(*path.parts[1:]) | |