Skip to content

Commit

Permalink
refactor(api): add touch_tip, mix, air_gap, blow_out, return_tip. Add…
Browse files Browse the repository at this point in the history
… TransferPlan Class.

 Closes #2242
  • Loading branch information
sanni-t committed Jan 11, 2019
1 parent 93b2d84 commit ffa8909
Show file tree
Hide file tree
Showing 8 changed files with 1,640 additions and 22 deletions.
2 changes: 2 additions & 0 deletions api/docs/source/new_protocol_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ Robot and Pipette
.. autoclass:: opentrons.protocol_api.contexts.InstrumentContext
:members:

.. autoclass:: opentrons.protocol_api.transfers.TransferOptions
:members:

.. _protocol-api-labware:

Expand Down
4 changes: 4 additions & 0 deletions api/src/opentrons/hardware_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class MustHomeError(RuntimeError):
pass


class NoTipAttachedError(RuntimeError):
pass


_Backend = Union[Controller, Simulator]
Instruments = Dict[top_types.Mount, Optional[Pipette]]
SHAKE_OFF_TIPS_SPEED = 50
Expand Down
400 changes: 382 additions & 18 deletions api/src/opentrons/protocol_api/contexts.py

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions api/src/opentrons/protocol_api/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ class WellShape(Enum):


class Well:
"""
The Well class represents a single well in a :py:class:`Labware`
It provides functions to return positions used in operations on the well
such as :py:meth:`top`, :py:meth:`bottom`
"""
def __init__(self, well_props: dict,
parent: Location,
display_name: str,
Expand Down Expand Up @@ -85,22 +91,22 @@ def has_tip(self) -> bool:
def has_tip(self, value: bool):
self._has_tip = value

def top(self) -> Location:
def top(self, z: float = 0.0) -> Location:
"""
:return: a Point corresponding to the absolute position of the
top-center of the well relative to the deck (with the front-left corner
of slot 1 as (0,0,0))
"""
return Location(self._position, self)
return Location(self._position + Point(0, 0, z), self)

def bottom(self) -> Location:
def bottom(self, z: float = 0.0) -> Location:
"""
:return: a Point corresponding to the absolute position of the
bottom-center of the well (with the front-left corner of slot 1 as
(0,0,0))
"""
top = self.top()
bottom_z = top.point.z - self._depth
bottom_z = top.point.z - self._depth + z
return Location(Point(x=top.point.x, y=top.point.y, z=bottom_z), self)

def center(self) -> Location:
Expand Down
Loading

0 comments on commit ffa8909

Please sign in to comment.