Skip to content

Commit

Permalink
lint: enable ruff RET504 rule
Browse files Browse the repository at this point in the history
  • Loading branch information
unexcellent committed Oct 29, 2024
1 parent e78c29a commit b48ff16
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ ignore = [
"EM102",
"F401",
"SIM102",
"RET504",
]

[tool.mypy]
Expand Down
3 changes: 1 addition & 2 deletions raillabel/format/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,13 @@ def fromdict(
Converted Frame object.
"""
frame = Frame(
return Frame(
uid=int(uid),
timestamp=cls._timestamp_fromdict(data_dict),
sensors=cls._sensors_fromdict(data_dict, sensors),
frame_data=cls._frame_data_fromdict(data_dict, sensors),
annotations=cls._objects_fromdict(data_dict, objects, sensors),
)
return frame

def asdict(self) -> dict:
"""Export self as a dict compatible with the OpenLABEL schema.
Expand Down
4 changes: 1 addition & 3 deletions raillabel/format/intrinsics_pinhole.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ def asdict(self) -> dict:
if an attribute can not be converted to the type required by the OpenLabel schema.
"""
dict_repr = {
return {
"camera_matrix": list(self.camera_matrix),
"distortion_coeffs": list(self.distortion),
"width_px": int(self.width_px),
"height_px": int(self.height_px),
}

return dict_repr
4 changes: 1 addition & 3 deletions raillabel/format/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ def asdict(self) -> dict:
if an attribute can not be converted to the type required by the OpenLabel schema.
"""
dict_repr = {
return {
"translation": self.pos.asdict(),
"quaternion": self.quat.asdict(),
}

return dict_repr

0 comments on commit b48ff16

Please sign in to comment.