@@ -135,7 +135,9 @@ def __init__(self, prefix: str, name: str = "") -> None:
135135 super ().__init__ (name = name )
136136
137137 async def beamline_status_or_error (
138- self , expected_state : BeamlineStatus , sample_location : SampleLocation = None
138+ self ,
139+ expected_state : BeamlineStatus ,
140+ sample_location : SampleLocation | None = None ,
139141 ):
140142 """This co-routine will finish when either the beamline reaches the specified
141143 state or the robot gives an error (whichever happens first). In the case where
@@ -158,18 +160,21 @@ async def raise_if_error():
158160 async def wait_for_expected_state ():
159161 await wait_for_value (self .beamline_disabled , expected_state .value , None )
160162
161- async def wait_for_puck ():
162- await wait_for_value (self .current_puck , sample_location .puck , None )
163+ async def wait_for_puck (_sample_location : SampleLocation ):
164+ await wait_for_value (self .current_puck , _sample_location .puck , None )
163165
164- async def wait_for_pin ():
165- await wait_for_value (self .current_pin , sample_location .pin , None )
166+ async def wait_for_pin (_sample_location : SampleLocation ):
167+ await wait_for_value (self .current_pin , _sample_location .pin , None )
166168
167169 check_for_error_task = Task (raise_if_error ())
168170 tasks = [
169171 (Task (wait_for_expected_state ())),
170172 ]
171173 if sample_location :
172- tasks += [Task (wait_for_puck ()), Task (wait_for_pin ())]
174+ tasks += [
175+ Task (wait_for_puck (sample_location )),
176+ Task (wait_for_pin (sample_location )),
177+ ]
173178 check_for_completion_conditions = asyncio .create_task (
174179 asyncio .wait (tasks , return_when = ALL_COMPLETED )
175180 )
@@ -210,7 +215,7 @@ async def _load_pin_and_puck(self, sample_location: SampleLocation):
210215 await self ._wait_for_beamline_enabled_after_load_or_unload (sample_location )
211216
212217 async def _wait_for_beamline_enabled_after_load_or_unload (
213- self , sample_location : SampleLocation = None
218+ self , sample_location : SampleLocation
214219 ):
215220 if await self .beamline_disabled .get_value () == BeamlineStatus .ENABLED .value :
216221 LOGGER .info (WAIT_FOR_BEAMLINE_DISABLE_MSG )
0 commit comments