Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vegano1 committed Aug 5, 2024
1 parent dee2dc2 commit ac36374
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 18 deletions.
4 changes: 1 addition & 3 deletions api/src/opentrons/drivers/absorbance_reader/async_byonoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ async def update_firmware(self, firmware_file_path: str) -> Tuple[bool, str]:
handle = self._verify_device_handle()
if not os.path.exists(firmware_file_path):
return False, f"Firmware file not found: {firmware_file_path}"
# TODO: verify if this needs to run in this context or executor thread
# err = self._interface.byonoy_update_device(handle, firmware_file_path)
err = await self._loop.run_in_executor(
executor=self._executor,
func=partial(
Expand Down Expand Up @@ -287,7 +285,7 @@ def _initialize(self, wavelength: int) -> None:
self._initialize_measurement(conf)

async def initialize(self, wavelength: int) -> None:
"""???"""
"""Initialize the device so we can start reading samples from it."""
await self._loop.run_in_executor(
executor=self._executor, func=partial(self._initialize, wavelength)
)
Expand Down
3 changes: 0 additions & 3 deletions api/src/opentrons/drivers/absorbance_reader/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ def __init__(self, connection: AsyncByonoyType) -> None:
async def connect(self) -> None:
"""Connect to absorbance reader"""
await self._connection.open()
# The Absorbance reader needs to initialize after opening a connection
# This takes about 10 seconds, so lets wait 15 to be safe.
# await asyncio.sleep(15)

async def disconnect(self) -> None:
"""Disconnect from absorbance reader"""
Expand Down
7 changes: 4 additions & 3 deletions api/src/opentrons/hardware_control/backends/ot3controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ def update_feature_flags(self, feature_flags: HardwareFeatureFlags) -> None:
async def update_motor_status(self) -> None:
"""Retreieve motor and encoder status and position from all present nodes"""
motor_nodes = self._motor_nodes()
if motor_nodes:
response = await get_motor_position(self._messenger, motor_nodes)
self._handle_motor_status_response(response)
assert len(motor_nodes)
response = await get_motor_position(self._messenger, motor_nodes)
self._handle_motor_status_response(response)

async def update_motor_estimation(self, axes: Sequence[Axis]) -> None:
"""Update motor position estimation for commanded nodes, and update cache of data."""
Expand Down Expand Up @@ -1142,6 +1142,7 @@ async def _handle_watch_event(self) -> None:
return
if event is not None:
flags = aionotify.Flags.parse(event.flags)
log.debug(f"aionotify: {flags} {event.name}")
if "ot_module" in event.name:
event_name = event.name
event_description = AionotifyEvent.build(event_name, flags)
Expand Down
14 changes: 7 additions & 7 deletions api/src/opentrons/hardware_control/backends/subsystem_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ def subsystems_to_update(self) -> List[SubSystem]:
return [target_to_subsystem(t) for t in self._updates_required.keys()]

async def start(self) -> None:
# await self._probe_network_and_cache_fw_updates(
# self._expected_core_targets, True
# )
# self._tool_detection_task = asyncio.create_task(
# self._tool_detection_task_main()
# )
# await self.refresh()
await self._probe_network_and_cache_fw_updates(
self._expected_core_targets, True
)
self._tool_detection_task = asyncio.create_task(
self._tool_detection_task_main()
)
await self.refresh()
log.info(f"Subsystem manager started with devices {self.device_info}")

async def refresh(self) -> None:
Expand Down
2 changes: 0 additions & 2 deletions api/src/opentrons/hardware_control/poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ async def _poll_once(self) -> None:
self._reader.on_error(e)
for waiter in previous_waiters:
Poller._set_waiter_complete(waiter, e)
# NOTE: For debugging
await self.stop()
else:
for waiter in previous_waiters:
Poller._set_waiter_complete(waiter)

0 comments on commit ac36374

Please sign in to comment.