Skip to content

Commit

Permalink
updated naming
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Oct 18, 2024
1 parent cb77025 commit aa5ff64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions api/src/opentrons/protocol_engine/commands/load_liquid.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ async def execute(
self._state_view.labware.validate_liquid_allowed_in_labware(
labware_id=params.labwareId, wells=params.volumeByWell
)
# do this in WellStore?!
# do this in WellStore? Don't have access to GeometryView
labware_id = params.labwareId
well_name = next(iter(params.volumeByWell))
volume = next(iter(params.volumeByWell.values()))
height = self._state_view.geometry.get_well_height_at_volume(
labware_id=labware_id, well_name=well_name, volume=volume
)
self._state_view.wells.set_liquid_height(
self._state_view.wells.set_liquid_height_from_load(
labware_id=labware_id,
well_name=well_name,
height=height,
Expand Down
12 changes: 6 additions & 6 deletions api/src/opentrons/protocol_engine/state/wells.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def handle_action(self, action: Action) -> None:

def _handle_succeeded_command(self, command: Command) -> None:
if isinstance(command.result, LiquidProbeResult):
self._set_liquid_height(
self._set_liquid_height_from_probe(
labware_id=command.params.labwareId,
well_name=command.params.wellName,
height=command.result.z_position,
Expand All @@ -49,17 +49,17 @@ def _handle_succeeded_command(self, command: Command) -> None:

def _handle_failed_command(self, action: FailCommandAction) -> None:
if isinstance(action.error, LiquidNotFoundError):
self._set_liquid_height(
self._set_liquid_height_from_probe(
labware_id=action.error.private.labware_id,
well_name=action.error.private.well_name,
height=None,
time=action.failed_at,
)

def _set_liquid_height(
def _set_liquid_height_from_probe(
self, labware_id: str, well_name: str, height: float, time: datetime
) -> None:
"""Set the liquid height of the well."""
"""Set the liquid height of the well from a LiquidProbe command."""
lhi = LiquidHeightInfo(height=height, last_measured=time)
if labware_id not in self._state.measured_liquid_heights:
self._state.measured_liquid_heights[labware_id] = {}
Expand Down Expand Up @@ -128,10 +128,10 @@ def has_measured_liquid_height(self, labware_id: str, well_name: str) -> bool:
except KeyError:
return False

def set_liquid_height(
def set_liquid_height_from_load(
self, labware_id: str, well_name: str, height: float, time: datetime
) -> None:
"""Set the liquid height of the well."""
"""Set the liquid height of the well from a LoadLiquid command."""
lhi = LiquidHeightInfo(height=height, last_measured=time)
if labware_id not in self._state.measured_liquid_heights:
self._state.measured_liquid_heights[labware_id] = {}
Expand Down

0 comments on commit aa5ff64

Please sign in to comment.