Check for "/" in feature names (#660)

This commit is contained in:
Thomas Lips
2025-01-29 21:54:49 +01:00
committed by GitHub
parent 4323bdce22
commit c4d912a241
2 changed files with 24 additions and 0 deletions

View File

@@ -304,6 +304,13 @@ class LeRobotDatasetMetadata:
)
else:
# TODO(aliberts, rcadene): implement sanity check for features
# check if none of the features contains a "/" in their names,
# as this would break the dict flattening in the stats computation, which uses '/' as separator
for key in features:
if "/" in key:
raise ValueError(f"Feature names should not contain '/'. Found '/' in feature '{key}'.")
features = {**features, **DEFAULT_FEATURES}
obj.tasks, obj.stats, obj.episodes = {}, {}, []