Skip to content

Commit

Permalink
math fix
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Jan 14, 2025
1 parent 65c9758 commit bea6ff0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/src/opentrons/protocol_engine/execution/movement.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def move_to_well(
force_direct=force_direct,
minimum_z_height=minimum_z_height,
operation_volume=operation_volume,
is_tracking=is_tracking
is_tracking=is_tracking,
)

speed = self._state_store.pipettes.get_movement_speed(
Expand Down
10 changes: 5 additions & 5 deletions api/src/opentrons/protocol_engine/execution/pipetting.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,13 @@ async def aspirate_while_tracking(

aspirate_z_distance = self._state_view.geometry.get_liquid_handling_z_change(
labware_id=labware_id,
well_name=well_name, # make sure the protocol engine actually has the well name atp ?
operation_volume=volume * -1, # try this tomorrow
well_name=well_name,
operation_volume=volume * -1,
)
with self._set_flow_rate(pipette=hw_pipette, aspirate_flow_rate=flow_rate):
await self._hardware_api.aspirate_while_tracking(
mount=hw_pipette.mount,
z_distance=aspirate_z_distance * -1,
z_distance=aspirate_z_distance,
flow_rate=flow_rate,
volume=adjusted_volume,
)
Expand All @@ -210,13 +210,13 @@ async def dispense_while_tracking(

dispense_z_distance = self._state_view.geometry.get_liquid_handling_z_change(
labware_id=labware_id,
well_name=well_name, # make sure the protocol engine actually has the well name atp ?
well_name=well_name,
operation_volume=volume,
)
with self._set_flow_rate(pipette=hw_pipette, dispense_flow_rate=flow_rate):
await self._hardware_api.dispense_while_tracking(
mount=hw_pipette.mount,
z_distance=(dispense_z_distance * -1),
z_distance=dispense_z_distance,
flow_rate=flow_rate,
volume=adjusted_volume,
push_out=push_out,
Expand Down
4 changes: 3 additions & 1 deletion api/src/opentrons/protocol_engine/state/frustum_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ def find_height_at_well_volume(
volumetric_capacity = get_well_volumetric_capacity(well_geometry)
max_volume = sum(row[1] for row in volumetric_capacity)
if target_volume < 0 or target_volume > max_volume:
raise InvalidLiquidHeightFound(f"Invalid target volume {target_volume}, max vol {max_volume}.")
raise InvalidLiquidHeightFound(
f"Invalid target volume {target_volume}, max vol {max_volume}."
)

sorted_well = sorted(well_geometry.sections, key=lambda section: section.topHeight)
# find the section the target volume is in and compute the height
Expand Down
5 changes: 2 additions & 3 deletions api/src/opentrons/protocol_engine/state/geometry.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Geometry state getters."""

import enum

# import logging
from numpy import array, dot, double as npdouble
from numpy.typing import NDArray
Expand Down Expand Up @@ -1423,9 +1424,7 @@ def get_liquid_handling_z_change(
initial_height=initial_handling_height,
volume=operation_volume,
)
# uncomment this
# return final_height - initial_handling_height
return initial_handling_height - final_height
return final_height - initial_handling_height

def get_well_offset_adjustment(
self,
Expand Down

0 comments on commit bea6ff0

Please sign in to comment.