Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
andySigler committed Feb 6, 2025
1 parent 0ceaefd commit 7578db9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,17 @@ def aspirate_and_wait(self, volume: float) -> None:
# TODO: handle volume correction
aspirate_props = self._transfer_properties.aspirate
correction_volume = aspirate_props.correction_by_volume.get_for_volume(volume)
is_meniscus = bool(
aspirate_props.position_reference == PositionReference.LIQUID_MENISCUS
)
self._instrument.aspirate(
location=self._target_location,
well_core=None,
volume=volume,
rate=1,
flow_rate=aspirate_props.flow_rate_by_volume.get_for_volume(volume),
in_place=True,
is_meniscus=None, # TODO: update this once meniscus is implemented
is_meniscus=is_meniscus,
correction_volume=correction_volume,
)
self._tip_state.append_liquid(volume)
Expand All @@ -186,6 +189,9 @@ def dispense_and_wait(
# TODO: handle volume correction
dispense_props = self._transfer_properties.dispense
correction_volume = dispense_props.correction_by_volume.get_for_volume(volume)
is_meniscus = bool(
dispense_props.position_reference == PositionReference.LIQUID_MENISCUS
)
self._instrument.dispense(
location=self._target_location,
well_core=None,
Expand All @@ -194,7 +200,7 @@ def dispense_and_wait(
flow_rate=dispense_props.flow_rate_by_volume.get_for_volume(volume),
in_place=True,
push_out=push_out_override,
is_meniscus=None,
is_meniscus=is_meniscus,
correction_volume=correction_volume,
)
if push_out_override:
Expand Down Expand Up @@ -575,10 +581,11 @@ def absolute_point_from_position_reference_and_offset(
case PositionReference.WELL_CENTER:
reference_point = well.get_center()
case PositionReference.LIQUID_MENISCUS:
raise NotImplementedError(
"Liquid transfer using liquid-meniscus relative positioning"
" is not yet implemented."
)
# raise NotImplementedError(
# "Liquid transfer using liquid-meniscus relative positioning"
# " is not yet implemented."
# )
reference_point = well.get_meniscus()
case _:
raise ValueError(f"Unknown position reference {position_reference}")
return reference_point + Point(offset.x, offset.y, offset.z)
4 changes: 4 additions & 0 deletions api/src/opentrons/protocol_api/core/engine/well.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ def get_center(self) -> Point:
well_location=WellLocation(origin=WellOrigin.CENTER),
)

def get_meniscus(self) -> Point:
"""Get the coordinate of the well's meniscus."""
return self.get_bottom(self.current_liquid_height())

def load_liquid(
self,
liquid: Liquid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def get_center(self) -> Point:
"""Get the coordinate of the well's center."""
return self._geometry.center()

def get_meniscus(self) -> Point:
"""Get the coordinate of the well's center."""
raise APIVersionError(api_element="Getting a meniscus")

def load_liquid(
self,
liquid: Liquid,
Expand Down
4 changes: 4 additions & 0 deletions api/src/opentrons/protocol_api/core/well.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def get_bottom(self, z_offset: float) -> Point:
def get_center(self) -> Point:
"""Get the coordinate of the well's center."""

@abstractmethod
def get_meniscus(self) -> Point:
"""Get the coordinate of the well's meniscus."""

@abstractmethod
def load_liquid(
self,
Expand Down

0 comments on commit 7578db9

Please sign in to comment.