Skip to content

Commit

Permalink
refactor(api, robot-server): remove/ update outdated TODOs (#16413)
Browse files Browse the repository at this point in the history
# Overview

Removes TODOs that have been addressed or are no longer relevant.
Updates outdated ones.
Details in comments.

## Risk assessment

None.
  • Loading branch information
sanni-t authored Oct 7, 2024
1 parent 7badfee commit fb6e437
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 32 deletions.
3 changes: 1 addition & 2 deletions api/src/opentrons/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,6 @@ def _run_file_non_pe(

context.home()
try:
# TODO (spp, 2024-03-18): use true run-time param overrides once enabled
# for cli protocol simulation/ execution
execute_apiv2.run_protocol(
protocol, context, run_time_parameters_with_overrides=None
)
Expand All @@ -626,6 +624,7 @@ def _run_file_pe(
"""Run a protocol file with Protocol Engine."""

async def run(protocol_source: ProtocolSource) -> None:
# TODO (spp, 2024-03-18): use run-time param overrides once enabled for cli protocol execution
hardware_api_wrapped = hardware_api.wrapped()
protocol_engine = await create_protocol_engine(
hardware_api=hardware_api_wrapped,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ def device_info(self) -> Mapping[str, str]:
@property
def live_data(self) -> LiveData:
return {
# TODO (spp, 2022-2-22): Revise what status includes
"status": self.status.value,
"data": {
"temperatureStatus": self.temperature_status.value,
Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/protocol_api/core/engine/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ def load_adapter(

return labware_core

# TODO (spp, 2022-12-14): https://opentrons.atlassian.net/browse/RLAB-237
def move_labware(
self,
labware_core: LabwareCore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ def load_adapter(
"""Load an adapter using its identifying parameters"""
raise APIVersionError(api_element="Loading adapter")

# TODO (spp, 2022-12-14): https://opentrons.atlassian.net/browse/RLAB-237
def move_labware(
self,
labware_core: LegacyLabwareCore,
Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/protocol_api/core/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def load_adapter(
"""Load an adapter using its identifying parameters"""
...

# TODO (spp, 2022-12-14): https://opentrons.atlassian.net/browse/RLAB-237
@abstractmethod
def move_labware(
self,
Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/protocol_api/protocol_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ def loaded_labwares(self) -> Dict[int, Labware]:
if slot is not None
}

# TODO (spp, 2022-12-14): https://opentrons.atlassian.net/browse/RLAB-237
@requires_version(2, 15)
def move_labware(
self,
Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/protocol_engine/commands/move_labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
_TRASH_CHUTE_DROP_BUFFER_MM = 8


# TODO (spp, 2022-12-14): https://opentrons.atlassian.net/browse/RLAB-237
class MoveLabwareParams(BaseModel):
"""Input parameters for a ``moveLabware`` command."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ async def raise_if_labware_latched_on_heater_shaker(
return # Labware on a module, but not a Heater-Shaker.

if hs_substate.labware_latch_status == HeaterShakerLatchStatus.CLOSED:
# TODO (spp, 2022-10-27): This only raises if latch status is 'idle_closed'.
# We need to update the flagger to raise if latch status is anything other
# than 'idle_open'
raise HeaterShakerLabwareLatchNotOpenError(
"Heater-Shaker labware latch must be open when moving labware to/from it."
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
_GRIPPER_HOMED_POSITION_Z = 166.125 # Height of the center of the gripper critical point from the deck when homed


# TODO (spp, 2022-10-20): name this GripperMovementHandler if it doesn't handle
# any non-gripper implementations
class LabwareMovementHandler:
"""Implementation logic for labware movement."""

Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/protocol_engine/state/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,6 @@ def _handle_thermocycler_module_commands(
target_block_temperature=block_temperature,
target_lid_temperature=None,
)
# TODO (spp, 2022-08-01): set is_lid_open to False upon lid commands' failure
elif isinstance(command.result, thermocycler.OpenLidResult):
self._state.substate_by_module_id[module_id] = ThermocyclerModuleSubState(
module_id=ThermocyclerModuleId(module_id),
Expand Down
3 changes: 1 addition & 2 deletions api/src/opentrons/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,8 +883,6 @@ def _run_file_non_pe(
context.home()
with scraper.scrape():
try:
# TODO (spp, 2024-03-18): use true run-time param overrides once enabled
# for cli protocol simulation/ execution
execute.run_protocol(
protocol, context, run_time_parameters_with_overrides=None
)
Expand Down Expand Up @@ -914,6 +912,7 @@ def _run_file_pe(
log_level: str,
) -> _SimulateResult:
"""Run a protocol file with Protocol Engine."""
# TODO (spp, 2024-03-18): use run-time param overrides once enabled for cli protocol simulation.

async def run(protocol_source: ProtocolSource) -> _SimulateResult:
hardware_api_wrapped = hardware_api.wrapped()
Expand Down
5 changes: 0 additions & 5 deletions robot-server/robot_server/instruments/instrument_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ class GripperData(BaseModel):
"""Data from attached gripper."""

jawState: str = Field(..., description="Gripper Jaw state.")
# TODO (spp, 2023-01-03): update calibration field as decided after
# spike https://opentrons.atlassian.net/browse/RSS-167
calibratedOffset: Optional[InstrumentCalibrationData] = Field(
None, description="Calibrated gripper offset."
)
Expand All @@ -93,9 +91,6 @@ class PipetteData(BaseModel):
None, description="Calibrated pipette offset."
)

# TODO (spp, 2022-12-20): update/ add fields according to client needs.
# add calibration data as decided by https://opentrons.atlassian.net/browse/RSS-167


class PipetteState(BaseModel):
"""State from an attached pipette."""
Expand Down
11 changes: 8 additions & 3 deletions robot-server/robot_server/instruments/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,15 @@ async def _get_attached_instruments_ot2(
async def get_attached_instruments(
hardware: Annotated[HardwareControlAPI, Depends(get_hardware)],
) -> PydanticResponse[SimpleMultiBody[AttachedItem]]:
"""Get a list of all attached instruments."""
"""Get a list of all attached instruments.
Note: This endpoint returns the full AttachedItem data for Flex instruments only.
On an OT-2, this endpoint will provide partial data of the OT-2 pipettes
(no pipette fw and calibration data), and will not fetch new data after
a pipette attachment/ removal.
"""
try:
# TODO (spp, 2023-01-06): revise according to
# https://opentrons.atlassian.net/browse/RET-1295
ot3_hardware = ensure_ot3_hardware(hardware_api=hardware)
return await _get_attached_instruments_ot3(ot3_hardware)
except HardwareNotSupportedError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _build_run(
id=run_id,
createdAt=created_at,
status=state_summary.status,
actions=[], # TODO (spp, 2023-04-23): wire up actions once they are allowed
actions=[],
errors=state_summary.errors,
labware=state_summary.labware,
labwareOffsets=state_summary.labwareOffsets,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@ async def create_run_command(
# behavior is to pass through `command_intent` without overriding it
command_intent = pe_commands.CommandIntent.SETUP
command_create = request_body.data.copy(update={"intent": command_intent})

# TODO (spp): re-add `RunStoppedError` exception catching if/when maintenance runs
# have actions.
command = await run_orchestrator_store.add_command_and_wait_for_interval(
request=command_create, wait_until_complete=waitUntilComplete, timeout=timeout
)
Expand Down
2 changes: 0 additions & 2 deletions robot-server/robot_server/service/legacy/routers/motors.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
async def get_engaged_motors(
hardware: Annotated[HardwareControlAPI, Depends(get_hardware)],
) -> model.EngagedMotors:
# TODO (spp, 2023-07-06): Implement fetching Flex's engaged motors
# https://opentrons.atlassian.net/browse/RET-1371
try:
engaged_axes = hardware.engaged_axes
axes_dict = {
Expand Down
2 changes: 0 additions & 2 deletions robot-server/tests/instruments/test_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ async def test_get_instruments_empty(
assert result.status_code == 200


# TODO (spp, 2022-01-17): remove xfail once robot server test flow is set up to handle
# OT2 vs OT3 tests correclty
@pytest.mark.ot3_only
async def test_get_all_attached_instruments(
decoy: Decoy,
Expand Down

0 comments on commit fb6e437

Please sign in to comment.