Skip to content

Commit 779bd42

Browse files
committed
Make Ruff happy
1 parent 04fa684 commit 779bd42

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

bitbots_motion/bitbots_animation_server/bitbots_animation_server/resource_manager.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,8 @@ def search(self, path, folders, filename=""):
7171

7272
path = next_path
7373
if not folders:
74-
return OSError(
75-
"Resource '%s' not found. folders was empty, \
76-
only filename provided"
77-
% (filename)
78-
)
79-
return OSError("Resource '%s' not found" % (str(folders) + filename))
74+
return OSError(f"Resource '{filename}' not found. folders was empty, only filename provided")
75+
return OSError(f"Resource '{str(folders) + filename}' not found")
8076

8177
def find(self, name, filename=""):
8278
"""
@@ -115,7 +111,7 @@ def find_animation(self, name):
115111
should be given without ``.json``.
116112
path = find_animation('walkready')
117113
"""
118-
return self.find(self.animpath, "%s.json" % name)
114+
return self.find(self.animpath, f"{name}.json")
119115

120116
def find_resource(self, name):
121117
"""Finds a resource relative to self.basepath"""

bitbots_vision/bitbots_vision/vision_modules/yoeo/object_manager.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os.path as osp
2-
from typing import Optional, Type
2+
from typing import Optional
33

44
import rclpy
55

@@ -16,7 +16,7 @@ class YOEOObjectManager:
1616
This class manages the creation and update of the YOEO handler instance.
1717
"""
1818

19-
_HANDLERS_BY_NAME: dict[str, Type[yoeo_handlers.YOEOHandlerTemplate]] = {
19+
_HANDLERS_BY_NAME: dict[str, type[yoeo_handlers.YOEOHandlerTemplate]] = {
2020
"openvino": yoeo_handlers.YOEOHandlerOpenVino,
2121
"onnx": yoeo_handlers.YOEOHandlerONNX,
2222
"pytorch": yoeo_handlers.YOEOHandlerPytorch,

0 commit comments

Comments
 (0)