From 0ec7c912e7f6441de4f2900856f6017fceeba1be Mon Sep 17 00:00:00 2001 From: CarolinePascal Date: Fri, 17 Jul 2026 15:23:21 +0200 Subject: [PATCH] migration: relabel robot_type to 'unknown' when SO name doesn't match structure is_so is decided purely from the robot_type string, so datasets labeled so100/so101 whose joint dim isn't a multiple of 6 carry a provably wrong label. Rewrite meta/info.json robot_type to 'unknown' in that case so the v3.0 output isn't misidentified as an SO arm. --- community_v3_migration/fix_dataset.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/community_v3_migration/fix_dataset.py b/community_v3_migration/fix_dataset.py index fad84279a..59a65d58a 100644 --- a/community_v3_migration/fix_dataset.py +++ b/community_v3_migration/fix_dataset.py @@ -17,6 +17,13 @@ def _stack(col_values) -> np.ndarray: return np.stack([np.asarray(v, dtype=np.float64) for v in col_values]) # (N, D) +def _set_robot_type(root: Path, robot_type: str) -> None: + info_path = root / "meta" / "info.json" + info = json.loads(info_path.read_text()) + info["robot_type"] = robot_type + info_path.write_text(json.dumps(info, indent=4)) + + def _rewrite_parquet(root: Path, encoding: str) -> None: for pq in sorted((root / "data").glob("*/*.parquet")): df = pd.read_parquet(pq) @@ -82,10 +89,12 @@ def fix_dataset_in_place(root) -> dict: dims = [feats[c]["shape"][0] for c in VALUE_COLS if c in feats and feats[c].get("shape")] if any(d % 6 != 0 for d in dims): # Not a plain stack of 6-joint SO arms (e.g. 7-dim with an appended EE pose): the - # degrees mapping doesn't apply, so migrate structurally and leave the values alone. - return {**cls, "converted": False, + # degrees mapping doesn't apply. The `so100`/`so101` robot_type is provably wrong for + # this structure, so relabel it 'unknown' and migrate structurally without touching values. + _set_robot_type(root, "unknown") + return {**cls, "robot_type": "unknown", "converted": False, "action": f"structural v2.1->v3.0 only; joint dims {dims} not a multiple of 6 " - "(non-standard arm), joint values left unchanged"} + "(non-standard arm), robot_type set to 'unknown', joint values left unchanged"} # drop stray files that would otherwise be uploaded for junk in (root / "meta").glob("info.json.bak"): junk.unlink()