From 3cf5e3c8cb93f803aebf6d1b744517f9f522d901 Mon Sep 17 00:00:00 2001 From: CarolinePascal Date: Wed, 20 May 2026 16:47:22 +0200 Subject: [PATCH] chore(format): format code --- src/lerobot/configs/__init__.py | 2 +- src/lerobot/datasets/dataset_writer.py | 2 +- src/lerobot/datasets/image_writer.py | 6 ++---- src/lerobot/robots/so_follower/so_follower.py | 2 +- src/lerobot/utils/feature_utils.py | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lerobot/configs/__init__.py b/src/lerobot/configs/__init__.py index b95c7f86b..70aaa3da6 100644 --- a/src/lerobot/configs/__init__.py +++ b/src/lerobot/configs/__init__.py @@ -34,8 +34,8 @@ from .types import ( from .video import ( VALID_VIDEO_CODECS, VIDEO_ENCODER_INFO_KEYS, - VideoEncoderConfig, DepthEncoderConfig, + VideoEncoderConfig, camera_encoder_defaults, depth_encoder_defaults, ) diff --git a/src/lerobot/datasets/dataset_writer.py b/src/lerobot/datasets/dataset_writer.py index ce69f8e5b..5a497f30f 100644 --- a/src/lerobot/datasets/dataset_writer.py +++ b/src/lerobot/datasets/dataset_writer.py @@ -53,9 +53,9 @@ from .io_utils import ( write_info, ) from .utils import ( + DEFAULT_DEPTH_PATH, DEFAULT_EPISODES_PATH, DEFAULT_IMAGE_PATH, - DEFAULT_DEPTH_PATH, update_chunk_file_indices, ) from .video_utils import ( diff --git a/src/lerobot/datasets/image_writer.py b/src/lerobot/datasets/image_writer.py index ae0764649..f88111493 100644 --- a/src/lerobot/datasets/image_writer.py +++ b/src/lerobot/datasets/image_writer.py @@ -56,11 +56,9 @@ def image_array_to_pil_image(image_array: np.ndarray, range_check: bool = True) Other shapes / channel counts raise ``NotImplementedError`` or ``ValueError``. """ - #TODO(CarolinePascal): 4 dimensions RGB-D images + # TODO(CarolinePascal): 4 dimensions RGB-D images if image_array.ndim not in (2, 3): - raise ValueError( - f"The array has {image_array.ndim} dimensions, but 2 or 3 is expected for an image." - ) + raise ValueError(f"The array has {image_array.ndim} dimensions, but 2 or 3 is expected for an image.") # Squeeze 3D single-channel inputs to 2D so depth maps work whether the # caller emits (H, W), (1, H, W), or (H, W, 1). diff --git a/src/lerobot/robots/so_follower/so_follower.py b/src/lerobot/robots/so_follower/so_follower.py index 77c5534be..1b15f6a0d 100644 --- a/src/lerobot/robots/so_follower/so_follower.py +++ b/src/lerobot/robots/so_follower/so_follower.py @@ -72,7 +72,7 @@ class SOFollower(Robot): for cam in self.cameras: features[cam] = (self.cameras[cam].height, self.cameras[cam].width, 3) if getattr(self.cameras[cam], "use_depth", False): - features[f"{cam}_depth"] = (self.cameras[cam].height, self.cameras[cam].width,1) + features[f"{cam}_depth"] = (self.cameras[cam].height, self.cameras[cam].width, 1) return features @cached_property diff --git a/src/lerobot/utils/feature_utils.py b/src/lerobot/utils/feature_utils.py index 3ac32ae5f..85a43f142 100644 --- a/src/lerobot/utils/feature_utils.py +++ b/src/lerobot/utils/feature_utils.py @@ -69,7 +69,7 @@ def hw_to_dataset_features( for key, ftype in hw_features.items() if ftype is float or (isinstance(ftype, PolicyFeature) and ftype.type != FeatureType.VISUAL) } - #TODO(CarolinePascal): we should not rely on the shape to determine if a feature is a camera ! + # TODO(CarolinePascal): we should not rely on the shape to determine if a feature is a camera ! cam_fts = {key: shape for key, shape in hw_features.items() if isinstance(shape, tuple)} if joint_fts and prefix == ACTION: