Skip to content

Commit 774eef9

Browse files
committed
fix ruff formatting
1 parent f5d0b6e commit 774eef9

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

zod/cli/extract_tsr_patches.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ def extract_tsr_patches(
7878
print("Will save dataset to", output_dir)
7979
output_dir.mkdir(parents=True, exist_ok=True)
8080

81-
assert not (
82-
padding_factor is not None and (padding_px_x is not None or padding_px_y is not None)
83-
), "Cannot specify both padding and padding_factor"
81+
assert not (padding_factor is not None and (padding_px_x is not None or padding_px_y is not None)), (
82+
"Cannot specify both padding and padding_factor"
83+
)
8484

8585
padding = (padding_px_x, padding_px_y) if (padding_px_x is not None and padding_px_y is not None) else None
8686

zod/cli/generate_coco_json.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,7 @@ def convert_to_coco(
135135
if cls not in OBJECT_CLASSES:
136136
typer.echo(f"ERROR: Invalid class: {cls}.")
137137
raise typer.Exit(1)
138-
typer.echo(
139-
"Converting ZOD to COCO format. " f"Version: {version}, anonymization: {anonymization}, classes: {classes}"
140-
)
138+
typer.echo(f"Converting ZOD to COCO format. Version: {version}, anonymization: {anonymization}, classes: {classes}")
141139

142140
zod_frames = ZodFrames(str(dataset_root), version.value)
143141

zod/data_classes/box.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ def crop_from_image(
244244
tuple: padding in all four directions | (left, top, right, bottom)
245245
"""
246246

247-
assert not (
248-
padding is not None and padding_factor is not None
249-
), "Cannot specify both padding and padding_factor"
247+
assert not (padding is not None and padding_factor is not None), (
248+
"Cannot specify both padding and padding_factor"
249+
)
250250

251251
if padding is not None:
252252
padding_x, padding_y = padding

zod/data_classes/ego_motion.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ def get_poses(self, target_ts: Union[np.ndarray, float]) -> np.ndarray:
3333
[N, 4, 4] array of interpolated poses for each timestamp.
3434
"""
3535
selfmin, selfmax = np.min(self.timestamps), np.max(self.timestamps)
36-
assert (selfmin <= np.min(target_ts)) and (
37-
selfmax >= np.max(target_ts)
38-
), f"targets not between pose timestamps, must be [{selfmin}, {selfmax}]"
36+
assert (selfmin <= np.min(target_ts)) and (selfmax >= np.max(target_ts)), (
37+
f"targets not between pose timestamps, must be [{selfmin}, {selfmax}]"
38+
)
3939

4040
if np.isin(target_ts, self.timestamps).all():
4141
return self.poses[self.timestamps.searchsorted(target_ts)]

zod/data_classes/info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ def get_camera_lidar_map(
6767
A tuple of the camera frame and the closest lidar frame.
6868
"""
6969
camera_name = f"{camera.value}_{anonymization.value}"
70-
assert (
71-
camera_name in self.camera_frames
72-
), f"Camera {camera_name} not found. Available cameras: {self.camera_frames.keys()}"
70+
assert camera_name in self.camera_frames, (
71+
f"Camera {camera_name} not found. Available cameras: {self.camera_frames.keys()}"
72+
)
7373
assert lidar in self.lidar_frames, f"Lidar {lidar} not found. Available lidars: {self.lidar_frames.keys()}"
7474

7575
for camera_frame in self.camera_frames[camera_name]:

zod/eval/detection/_experimental/matching.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ def match_one_frame(
285285
A list of tuples. Each tuple contains the ground truth object and the prediction.
286286
"""
287287
# check that all objects are in the evaluation frame
288-
assert all(
289-
gt.box3d.frame == EVALUATION_FRAME for gt in ground_truth if gt.box3d is not None
290-
), "All ground truth objects must be in the evaluation frame."
291-
assert all(
292-
pred.box3d.frame == EVALUATION_FRAME for pred in predictions
293-
), "All predictions must be in the evaluation frame."
288+
assert all(gt.box3d.frame == EVALUATION_FRAME for gt in ground_truth if gt.box3d is not None), (
289+
"All ground truth objects must be in the evaluation frame."
290+
)
291+
assert all(pred.box3d.frame == EVALUATION_FRAME for pred in predictions), (
292+
"All predictions must be in the evaluation frame."
293+
)
294294

295295
if method == "greedy":
296296
return greedy_match(

0 commit comments

Comments
 (0)