mani_skill.trajectory.merge_trajectory#
Functions#
|
|
|
Merges multiple JSON and H5 files into a single JSON and H5 file. |
Module Contents#
- mani_skill.trajectory.merge_trajectory.merge_trajectories(output_path, traj_paths, recompute_id=True)[source]#
Merges multiple JSON and H5 files into a single JSON and H5 file.
This function combines the contents of multiple JSON and H5 files. It keeps the first value for all keys (other than “episodes”) and logs a warning for any differences. The “episodes” from each JSON file are merged into a single list, and the corresponding H5 data is copied to the output H5 file.
- Parameters:
output_path (str) – The path to the output H5 file. The corresponding JSON file will be saved with the same name but with a .json extension.
traj_paths (list) – A list of paths to the input trajectory files (H5 files). The corresponding JSON files should have the same name but with a .json extension.
recompute_id (bool) – If True, recompute the episode IDs to ensure they are unique. If False, keep the original episode IDs.
- Raises:
AssertionError – If there is a conflict in the episode IDs when recompute_id is False.