Skip to content

Commit

Permalink
Code comment cleanup and removal of unused method
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyBatten committed Dec 12, 2023
1 parent 36b0e6b commit e17257f
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ async def _drop_tip(self) -> None:
axes=[MotorAxis.X, MotorAxis.Y, MotorAxis.LEFT_Z, MotorAxis.RIGHT_Z]
)

# TODO: We will need to instead use get_disposal_addressable_areas to return
# a list of trashes, and select one from there (fixedTrash if it exists takes priority)
# currently trashes are not loaded unless they are used, so if the protocl never uses
# a trash the addressable area store has no record that it exists.

# OT-2 Will only ever use the Fixed Trash Addressable Area
if self._state_store.config.robot_type == "OT-2 Standard":
for pipette_id, tip in attached_tips:
Expand Down
15 changes: 0 additions & 15 deletions api/src/opentrons/protocol_engine/state/addressable_areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,21 +336,6 @@ def get_all_cutout_fixtures(self) -> Optional[List[str]]:
for _, cutout_fixture_id in self._state.deck_configuration
]

def get_disposal_addressable_areas(self) -> List[str]:
"""Get a list of all loaded disposal locations by addressable area name."""
# TODO: Fixed Trash, Trash and WasteChute addressable areas are only added to
# loaded_addressable_areas_by_name when used, we should add them when loaded
loaded_disposal_locations = []
for area in self._state.loaded_addressable_areas_by_name:
if (
("fixedTrash" in area)
or ("movableTrash" in area)
or ("WasteChute" in area)
):
# Append any and all instances/configurations of a MovableTrash or a WasteChute from this deck config
loaded_disposal_locations.append(area)
return loaded_disposal_locations

def _get_loaded_addressable_area(
self, addressable_area_name: str
) -> AddressableArea:
Expand Down
16 changes: 1 addition & 15 deletions api/src/opentrons/protocol_runner/protocol_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,6 @@ def __init__(
drop_tips_after_run=drop_tips_after_run,
post_run_hardware_state=post_run_hardware_state,
)
# self._task_queue.set_post_hardware_run_state(
# post_run_hardware_state=post_run_hardware_state
# )
# self._task_queue.set_drop_tips_after_run(
# drop_tips_after_run=drop_tips_after_run
# )

async def load(
self, protocol_source: ProtocolSource, python_parse_mode: PythonParseMode
Expand Down Expand Up @@ -248,12 +242,6 @@ def __init__(
drop_tips_after_run=drop_tips_after_run,
post_run_hardware_state=post_run_hardware_state,
)
# self._task_queue.set_post_hardware_run_state(
# post_run_hardware_state=post_run_hardware_state
# )
# self._task_queue.set_drop_tips_after_run(
# drop_tips_after_run=drop_tips_after_run
# )

self._hardware_api.should_taskify_movement_execution(taskify=False)

Expand Down Expand Up @@ -343,9 +331,7 @@ def __init__(
# TODO(mc, 2022-01-11): replace task queue with specific implementations
# of runner interface
self._hardware_api = hardware_api
self._task_queue = (
task_queue or TaskQueue()
) # cleanup_func=protocol_engine.finish)
self._task_queue = task_queue or TaskQueue()
self._task_queue.set_cleanup_func(func=protocol_engine.finish)

self._hardware_api.should_taskify_movement_execution(taskify=False)
Expand Down
6 changes: 0 additions & 6 deletions api/src/opentrons/protocol_runner/task_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,3 @@ async def _run(self) -> None:

if self._cleanup_func is not None:
await self._cleanup_func(error)

# await self._cleanup_func(
# error=error,
# drop_tips_after_run=self._drop_tips_after_run,
# post_run_hardware_state=self._post_hardware_run_state,
# )
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ async def test_hardware_stopping_sequence_without_pipette_tips(
) -> None:
"""Don't drop tip when there aren't any tips attached to pipettes."""
decoy.when(state_store.pipettes.get_all_attached_tips()).then_return([])
decoy.when(
state_store.addressable_areas.get_disposal_addressable_areas()
).then_return(["fixedTrash"])

await subject.do_stop_and_recover(
drop_tips_after_run=True,
Expand Down Expand Up @@ -185,10 +182,6 @@ async def test_hardware_stopping_sequence_no_pipette(
),
).then_raise(HwPipetteNotAttachedError("oh no"))

decoy.when(
state_store.addressable_areas.get_disposal_addressable_areas()
).then_return(["fixedTrash"])

await subject.do_stop_and_recover(
drop_tips_after_run=True,
post_run_hardware_state=PostRunHardwareState.HOME_AND_STAY_ENGAGED,
Expand Down
1 change: 0 additions & 1 deletion robot-server/robot_server/runs/engine_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ async def create(
deck_configuration=deck_configuration,
)

# TODO: Replace this robot type based logic with a settings flag controlled feature to toggle end-state behavior
post_run_hardware_state = PostRunHardwareState.HOME_AND_STAY_ENGAGED
drop_tips_after_run = True
if self._robot_type == "OT-3 Standard":
Expand Down

0 comments on commit e17257f

Please sign in to comment.