From 746f0d3327ff24c21af2271c88da2f3d583d4e25 Mon Sep 17 00:00:00 2001 From: Maurice Van Wassenhove Date: Sat, 20 Apr 2024 11:15:10 +0200 Subject: [PATCH] chore: make pyright happy --- drumpy/app/fps_display.py | 2 +- drumpy/app/main.py | 2 +- drumpy/app/video_source.py | 4 ++-- drumpy/drum/drum.py | 2 +- drumpy/drum/sound.py | 16 ++++++++-------- drumpy/tracking/drum_trackers.py | 2 +- drumpy/tracking/marker_tracker.py | 2 +- drumpy/tracking/marker_tracker_wrapper.py | 4 ++-- drumpy/trajectory_file.py | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drumpy/app/fps_display.py b/drumpy/app/fps_display.py index 4719cb0..88224ea 100644 --- a/drumpy/app/fps_display.py +++ b/drumpy/app/fps_display.py @@ -16,7 +16,7 @@ class FPSDisplay(UILabel): """ def __init__( - self: Self, + self, ui_manager: UIManager, media_pipe_pose: MediaPipePose, ) -> None: diff --git a/drumpy/app/main.py b/drumpy/app/main.py index bd57e8a..90385ac 100644 --- a/drumpy/app/main.py +++ b/drumpy/app/main.py @@ -21,7 +21,7 @@ class App: """ def __init__( - self: Self, + self, source: Source = Source.CAMERA, file_path: Optional[str] = None, running_mode: RunningMode = RunningMode.LIVE_STREAM, # type: ignore diff --git a/drumpy/app/video_source.py b/drumpy/app/video_source.py index 66dd5b9..a004aaf 100644 --- a/drumpy/app/video_source.py +++ b/drumpy/app/video_source.py @@ -34,7 +34,7 @@ class VideoSource(ABC): Abstract base class for a video source """ - def __init__(self: Self) -> None: + def __init__(self) -> None: self.stopped = False @abstractmethod @@ -145,7 +145,7 @@ class CameraSource(VideoSource): Class to handle a video source from a camera """ - def __init__(self: Self, camera_index: int) -> None: + def __init__(self, camera_index: int) -> None: super().__init__() camera.init() cameras = camera.list_cameras() diff --git a/drumpy/drum/drum.py b/drumpy/drum/drum.py index 478073a..b32e328 100644 --- a/drumpy/drum/drum.py +++ b/drumpy/drum/drum.py @@ -45,7 +45,7 @@ class Drum: """ def __init__( - self: Self, + self, sounds: list[Sound], sleep_option: SleepOption = SleepOption.SLEEP, ) -> None: diff --git a/drumpy/drum/sound.py b/drumpy/drum/sound.py index 8e34b49..8911269 100644 --- a/drumpy/drum/sound.py +++ b/drumpy/drum/sound.py @@ -29,7 +29,7 @@ class Sound: """ def __init__( - self: Self, + self, name: str, path: str, margin: float, @@ -117,7 +117,7 @@ def hit(self: Self, position: Position) -> None: class SnareDrum(Sound): - def __init__(self: Self) -> None: + def __init__(self) -> None: super().__init__( "Snare Drum", "./DrumSamples/Snare/CKV1_Snare Loud.wav", @@ -126,7 +126,7 @@ def __init__(self: Self) -> None: class HiHat(Sound): - def __init__(self: Self) -> None: + def __init__(self) -> None: super().__init__( "High Hat", "./DrumSamples/HiHat/CKV1_HH Closed Loud.wav", @@ -135,7 +135,7 @@ def __init__(self: Self) -> None: class KickDrum(Sound): - def __init__(self: Self) -> None: + def __init__(self) -> None: super().__init__( "Kick Drum", "./DrumSamples/Kick/CKV1_Kick Loud.wav", @@ -144,7 +144,7 @@ def __init__(self: Self) -> None: class HiHatFoot(Sound): - def __init__(self: Self) -> None: + def __init__(self) -> None: super().__init__( "High Hat Foot", "./DrumSamples/HiHat/CKV1_HH Foot.wav", @@ -153,7 +153,7 @@ def __init__(self: Self) -> None: class Tom1(Sound): - def __init__(self: Self) -> None: + def __init__(self) -> None: super().__init__( "Tom 1", "./DrumSamples/Perc/Tom1.wav", @@ -162,7 +162,7 @@ def __init__(self: Self) -> None: class Tom2(Sound): - def __init__(self: Self) -> None: + def __init__(self) -> None: super().__init__( "Tom 2", "./DrumSamples/Perc/Tom2.wav", @@ -171,7 +171,7 @@ def __init__(self: Self) -> None: class Cymbal(Sound): - def __init__(self: Self) -> None: + def __init__(self) -> None: super().__init__( "Cymbal", "./DrumSamples/cymbals/Hop_Crs.wav", diff --git a/drumpy/tracking/drum_trackers.py b/drumpy/tracking/drum_trackers.py index 3913566..1eb034e 100644 --- a/drumpy/tracking/drum_trackers.py +++ b/drumpy/tracking/drum_trackers.py @@ -13,7 +13,7 @@ class DrumTrackers: Objects of this class are used to update the positions of the trackers """ - def __init__(self: Self) -> None: + def __init__(self) -> None: snare_drum = SnareDrum() hi_hat = HiHat() kick_drum = KickDrum() diff --git a/drumpy/tracking/marker_tracker.py b/drumpy/tracking/marker_tracker.py index cb0d9ea..ab705e2 100644 --- a/drumpy/tracking/marker_tracker.py +++ b/drumpy/tracking/marker_tracker.py @@ -15,7 +15,7 @@ class MarkerTracker: """ def __init__( - self: Self, + self, marker: MarkerEnum, drum: Drum, sounds: list[Sound], diff --git a/drumpy/tracking/marker_tracker_wrapper.py b/drumpy/tracking/marker_tracker_wrapper.py index 776fda3..682ca2d 100644 --- a/drumpy/tracking/marker_tracker_wrapper.py +++ b/drumpy/tracking/marker_tracker_wrapper.py @@ -26,7 +26,7 @@ def update(self: Self, markers: list[Landmark]) -> None: class DrumStick(MarkerTrackerWrapper): def __init__( - self: Self, + self, wrist: MarkerEnum, pinky: MarkerEnum, index: MarkerEnum, @@ -80,7 +80,7 @@ def right_hand(drum: Drum, sounds: list[Sound]) -> MarkerTrackerWrapper: class Foot(MarkerTrackerWrapper): - def __init__(self: Self, toe_tip: MarkerEnum, tracker: MarkerTracker) -> None: + def __init__(self, toe_tip: MarkerEnum, tracker: MarkerTracker) -> None: self.toe_tip = toe_tip self.position: Position = np.array([0, 0, 0]) self.tracker = tracker diff --git a/drumpy/trajectory_file.py b/drumpy/trajectory_file.py index d375b95..dd7a155 100644 --- a/drumpy/trajectory_file.py +++ b/drumpy/trajectory_file.py @@ -9,7 +9,7 @@ class TrajectoryFile: Class to read and write the captured data to a CSV file. """ - def __init__(self: Self, path: str) -> None: + def __init__(self, path: str) -> None: fieldnames = [ "frame", "time",