From 4e52a00be2dd80b7c7ba6dcf9476ea572d5e48a6 Mon Sep 17 00:00:00 2001 From: Dominic Oram Date: Tue, 23 Jul 2024 11:27:36 +0100 Subject: [PATCH] Fix some typing issues --- src/dodal/devices/aperturescatterguard.py | 8 ++++---- src/dodal/devices/thawer.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dodal/devices/aperturescatterguard.py b/src/dodal/devices/aperturescatterguard.py index 5537b59755..755543fd93 100644 --- a/src/dodal/devices/aperturescatterguard.py +++ b/src/dodal/devices/aperturescatterguard.py @@ -196,12 +196,12 @@ def load_aperture_positions(self, positions: AperturePositions): self.aperture_positions = positions @AsyncStatus.wrap - async def set(self, pos: SingleAperturePosition): + async def set(self, value: SingleAperturePosition): assert isinstance(self.aperture_positions, AperturePositions) - if pos not in self.aperture_positions.as_list(): - raise InvalidApertureMove(f"Unknown aperture: {pos}") + if value not in self.aperture_positions.as_list(): + raise InvalidApertureMove(f"Unknown aperture: {value}") - await self._safe_move_within_datacollection_range(pos.location) + await self._safe_move_within_datacollection_range(value.location) def _get_motor_list(self): return [ diff --git a/src/dodal/devices/thawer.py b/src/dodal/devices/thawer.py index 32c849bc3b..f329024b60 100644 --- a/src/dodal/devices/thawer.py +++ b/src/dodal/devices/thawer.py @@ -15,7 +15,7 @@ class ThawerStates(str, Enum): ON = "On" -class ThawingTimer(Device): +class ThawingTimer(Device, Stoppable): def __init__(self, control_signal: SignalRW[ThawerStates]) -> None: self._control_signal = control_signal self._thawing_task: Task | None = None @@ -33,7 +33,7 @@ async def set(self, time_to_thaw_for: float): await self._control_signal.set(ThawerStates.OFF) @AsyncStatus.wrap - async def stop(self, *args): + async def stop(self, *args, **kwargs): if self._thawing_task: self._thawing_task.cancel() @@ -45,6 +45,6 @@ def __init__(self, prefix: str, name: str = "") -> None: super().__init__(name) @AsyncStatus.wrap - async def stop(self, *args): + async def stop(self, *args, **kwargs): await self.thaw_for_time_s.stop() await self.control.set(ThawerStates.OFF)