Skip to content

Commit

Permalink
Robot server fix up all tests except tavern
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura-Danielle committed Oct 20, 2020
1 parent 69d25c7 commit 8f225c6
Show file tree
Hide file tree
Showing 8 changed files with 265 additions and 172 deletions.
11 changes: 4 additions & 7 deletions robot-server/robot_server/robot/calibration/check/user_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(
self._active_tiprack = self._load_active_tiprack()

self._command_map: COMMAND_MAP = {
CalibrationCommand.load_labware: self.load_labware,
CalibrationCommand.load_labware: self.transition,
CalibrationCommand.jog: self.jog,
CalibrationCommand.pick_up_tip: self.pick_up_tip,
CalibrationCommand.invalidate_tip: self.invalidate_tip,
Expand All @@ -97,7 +97,7 @@ def __init__(
DeckCalibrationCommand.move_to_point_three: self.move_to_point_three, # noqa: E501
CheckCalibrationCommand.switch_pipette: self.change_active_pipette,
CheckCalibrationCommand.return_tip: self._return_tip,
CheckCalibrationCommand.transition: self.load_labware,
CheckCalibrationCommand.transition: self.transition,
CalibrationCommand.exit: self.exit_session,
}

Expand Down Expand Up @@ -129,7 +129,7 @@ def active_tiprack(self) -> labware.Labware:
def _hw_pipette(self) -> Pipette:
return self._get_hw_pipettes()[0]

async def load_labware(self):
async def transition(self):
pass

async def change_active_pipette(self):
Expand Down Expand Up @@ -314,9 +314,7 @@ def get_instruments(self) -> List[CheckAttachedPipette]:
being used for a given session for the client.
"""
hw_pips = self._get_hw_pipettes()
MODULE_LOG.info(f"HW PIPS: {hw_pips}")
info_pips = self._get_ordered_info_pipettes()
MODULE_LOG.info(f"INFO PIPS: {info_pips}")
return [
CheckAttachedPipette( # type: ignore[call-arg]
model=hw_pip.model,
Expand Down Expand Up @@ -551,7 +549,7 @@ async def move_to_tip_rack(self):
handler="move_to_tip_rack",
condition="active tiprack")
point = self.active_tiprack.wells()[0].top().point + \
MOVE_TO_TIP_RACK_SAFETY_BUFFER
MOVE_TO_TIP_RACK_SAFETY_BUFFER
to_loc = Location(point, None)
await self._move(to_loc)
await self.register_initial_point()
Expand Down Expand Up @@ -605,7 +603,6 @@ async def _move(self, to_loc: Location):
await uf.move(self, to_loc)

async def exit_session(self):
MODULE_LOG.info("exit session was initiated")
if self._hw_pipette.has_tip:
await self.move_to_tip_rack()
await self._return_tip()
Expand Down
4 changes: 2 additions & 2 deletions robot-server/robot_server/robot/calibration/models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional, List
from typing import Optional
from pydantic import BaseModel, Field


Expand All @@ -20,7 +20,7 @@ class SessionCreateParams(BaseModel):
)
tipRackDefinition: Optional[dict] = Field(
None,
description='The full tiprack definition(s)'
description='The full tiprack definition'
'to use for a calibration session.'
)
shouldPerformTipLength: bool = Field(
Expand Down
2 changes: 0 additions & 2 deletions robot-server/robot_server/service/legacy/models/pipettes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class AttachedPipette(BaseModel):
id: typing.Optional[str] = \
Field(...,
description="The serial number of the attached pipette")
rank: typing.Optional[str] = \
Field(None, description="The order of a pipette, if relevant")


class PipettesByMount(BaseModel):
Expand Down
3 changes: 0 additions & 3 deletions robot-server/robot_server/service/session/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ async def delete_session_handler(
session_obj = get_session(manager=session_manager,
session_id=sessionId,
api_router=router)
log.info("delete was called! ")
log.info(f"session object {session_obj}")
await session_manager.remove(session_obj.meta.identifier)

return SessionResponse(
Expand Down Expand Up @@ -157,7 +155,6 @@ async def session_command_execute_handler(
command_request.data.attributes.data)
command_result = await session_obj.command_executor.execute(command)

log.info(f"Command completed: {command}")
log.debug(f"Command result: {command_result}")

return CommandResponse(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Awaitable, cast, TYPE_CHECKING, List, Optional
from typing import Awaitable, cast, TYPE_CHECKING, List

from robot_server.robot.calibration.check.user_flow import\
CheckCalibrationUserFlow
Expand Down Expand Up @@ -49,15 +49,16 @@ async def create(cls,
configuration: SessionConfiguration,
instance_meta: SessionMetaData) -> BaseSession:
"""Create an instance"""
# (lc, 10-19-2020) For now, only pass in empty tipracks. We cannot
# (lc, 10-19-2020) For now, only pass in an empty list. We cannot
# have a session model with an optional tiprack for session
# create params right now because of the pydantic union problem.
tip_racks: List[Optional['LabwareDefinition']] = []
tip_racks: List = []
# if lights are on already it's because the user clicked the button,
# so a) we don't need to turn them on now and b) we shouldn't turn them
# off after
session_controls_lights =\
not configuration.hardware.get_lights()['rails']
await configuration.hardware.cache_instruments()
try:
calibration_check = CheckCalibrationUserFlow(
configuration.hardware,
Expand Down
Loading

0 comments on commit 8f225c6

Please sign in to comment.