From b4bd1e025f88ea5782d518defabb0e5683be893c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20J=C3=BClg?= Date: Sun, 21 Jun 2026 13:04:51 -0700 Subject: [PATCH] fix: assets path --- README.md | 10 ++++++++++ src/duobench/__init__.py | 14 +++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 364d1e2..aab3757 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,16 @@ cd duobench pip install -ve . ``` +### Asset Cache Location + +DuoBench resolves its asset directory from the `DUOBENCH_PREFIX` environment variable. If `DUOBENCH_PREFIX` is not set, it defaults to `~/.duobench`. + +On import, DuoBench checks whether that path exists. If it does not, the package downloads the matching asset archive from GitHub into that location automatically. This makes the default setup work out of the box, while still letting you point assets at a custom directory when needed. + +```shell +export DUOBENCH_PREFIX=/path/to/duobench-assets +``` + ## Quickstart Tasks need to be imported as `from duobench.tasks import `. diff --git a/src/duobench/__init__.py b/src/duobench/__init__.py index dc12c54..e4bf221 100644 --- a/src/duobench/__init__.py +++ b/src/duobench/__init__.py @@ -8,14 +8,14 @@ from rcs import get_prefix from rcs._core import common -RCS_DUOBENCH_GITHUB_ASSET_ARCHIVE_URL = "https://github.com/RobotControlStack/rcs_duobench/archive/refs/tags/{tag}.zip" +DUOBENCH_GITHUB_ASSET_ARCHIVE_URL = "https://github.com/RobotControlStack/duobench/archive/refs/tags/{tag}.zip" -RCS_DUOBENCH_PREFIX = get_prefix( - os.environ.get("RCS_DUOBENCH_PREFIX"), +DUOBENCH_PREFIX = get_prefix( + os.environ.get("DUOBENCH_PREFIX"), Path(__file__).resolve().parents[2], - Path.home() / ".rcs_duobench", + Path.home() / ".duobench", __version__, - RCS_DUOBENCH_GITHUB_ASSET_ARCHIVE_URL, + DUOBENCH_GITHUB_ASSET_ARCHIVE_URL, ) CAMERA_PATHS: dict[str, str] = {} @@ -97,10 +97,10 @@ "vention_world": "assets/scenes/vention_table/vention_world.xml", } -# Append RCS_DUOBENCH package prefix to all asset paths +# Append DUOBENCH package prefix to all asset paths for path_dict in (GRIPPER_PATHS, SCENE_PATHS, OBJECT_PATHS, CAMERA_PATHS): for name, path in path_dict.items(): - abs_path = os.path.join(RCS_DUOBENCH_PREFIX, path) + abs_path = os.path.join(DUOBENCH_PREFIX, path) if not os.path.isfile(abs_path): error_msg = f"Asset {name} not found at path: {abs_path}. Please make sure to download the assets." raise FileNotFoundError(error_msg)