Skip to content

Commit 4e6c7c7

Browse files
committed
Engine behavior clean up and removal of unnecessary parameters
1 parent 1689445 commit 4e6c7c7

File tree

17 files changed

+138
-167
lines changed

17 files changed

+138
-167
lines changed

api/src/opentrons/hardware_control/api.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ async def move_axes(
778778
position: Mapping[Axis, float],
779779
speed: Optional[float] = None,
780780
max_speeds: Optional[Dict[Axis, float]] = None,
781-
_expect_stalls: bool = False,
781+
expect_stalls: bool = False,
782782
) -> None:
783783
"""Moves the effectors of the specified axis to the specified position.
784784
The effector of the x,y axis is the center of the carriage.
@@ -1249,7 +1249,10 @@ async def pick_up_tip(
12491249
await self.prepare_for_aspirate(mount)
12501250

12511251
async def tip_drop_moves(
1252-
self, mount: top_types.Mount, home_after: bool = True
1252+
self,
1253+
mount: top_types.Mount,
1254+
home_after: bool = True,
1255+
ignore_plunger: Optional[bool] = False,
12531256
) -> None:
12541257
spec, _ = self.plan_check_drop_tip(mount, home_after)
12551258

api/src/opentrons/hardware_control/ot3api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ async def move_to(
11891189
speed: Optional[float] = None,
11901190
critical_point: Optional[CriticalPoint] = None,
11911191
max_speeds: Union[None, Dict[Axis, float], OT3AxisMap[float]] = None,
1192-
_expect_stalls: bool = False,
1192+
expect_stalls: bool = False,
11931193
) -> None:
11941194
"""Move the critical point of the specified mount to a location
11951195
relative to the deck, at the specified speed."""
@@ -1233,15 +1233,15 @@ async def move_to(
12331233
target_position,
12341234
speed=speed,
12351235
max_speeds=checked_max,
1236-
expect_stalls=_expect_stalls,
1236+
expect_stalls=expect_stalls,
12371237
)
12381238

12391239
async def move_axes( # noqa: C901
12401240
self,
12411241
position: Mapping[Axis, float],
12421242
speed: Optional[float] = None,
12431243
max_speeds: Optional[Dict[Axis, float]] = None,
1244-
_expect_stalls: bool = False,
1244+
expect_stalls: bool = False,
12451245
) -> None:
12461246
"""Moves the effectors of the specified axis to the specified position.
12471247
The effector of the x,y axis is the center of the carriage.
@@ -1300,7 +1300,7 @@ async def move_axes( # noqa: C901
13001300
await self._move(
13011301
target_position=absolute_positions,
13021302
speed=speed,
1303-
expect_stalls=_expect_stalls,
1303+
expect_stalls=expect_stalls,
13041304
)
13051305

13061306
async def move_rel(
@@ -1311,7 +1311,7 @@ async def move_rel(
13111311
max_speeds: Union[None, Dict[Axis, float], OT3AxisMap[float]] = None,
13121312
check_bounds: MotionChecks = MotionChecks.NONE,
13131313
fail_on_not_homed: bool = False,
1314-
_expect_stalls: bool = False,
1314+
expect_stalls: bool = False,
13151315
) -> None:
13161316
"""Move the critical point of the specified mount by a specified
13171317
displacement in a specified direction, at the specified speed."""
@@ -1353,7 +1353,7 @@ async def move_rel(
13531353
speed=speed,
13541354
max_speeds=checked_max,
13551355
check_bounds=check_bounds,
1356-
expect_stalls=_expect_stalls,
1356+
expect_stalls=expect_stalls,
13571357
)
13581358

13591359
async def _cache_and_maybe_retract_mount(self, mount: OT3Mount) -> None:

api/src/opentrons/hardware_control/protocols/motion_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ async def move_axes(
171171
position: Mapping[Axis, float],
172172
speed: Optional[float] = None,
173173
max_speeds: Optional[Dict[Axis, float]] = None,
174-
_expect_stalls: bool = False,
174+
expect_stalls: bool = False,
175175
) -> None:
176176
"""Moves the effectors of the specified axis to the specified position.
177177
The effector of the x,y axis is the center of the carriage.

api/src/opentrons/legacy_commands/commands.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,10 @@ def unseal(
327327

328328
def resin_tip_dispense(
329329
instrument: InstrumentContext,
330-
flow_rate: float,
330+
flow_rate: float | None,
331331
) -> command_types.PressurizeCommand:
332+
if flow_rate is None:
333+
flow_rate = 10 # The Protocol Engine default for Resin Tip Dispense
332334
text = f"Pressurize pipette to dispense from resin tip at {flow_rate}uL/s."
333335
return {
334336
"name": command_types.PRESSURIZE,

api/src/opentrons/legacy_commands/types.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,15 +540,17 @@ class MoveLabwareCommandPayload(TextOnlyPayload):
540540

541541

542542
class SealCommandPayload(TextOnlyPayload):
543-
pass
543+
instrument: InstrumentContext
544+
location: Union[None, Location, Well]
544545

545546

546547
class UnsealCommandPayload(TextOnlyPayload):
547-
pass
548+
instrument: InstrumentContext
549+
location: Union[None, Location, Well]
548550

549551

550552
class PressurizeCommandPayload(TextOnlyPayload):
551-
pass
553+
instrument: InstrumentContext
552554

553555

554556
class MoveLabwareCommand(TypedDict):

api/src/opentrons/protocol_api/core/engine/instrument.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,7 @@ def resin_tip_seal(
701701
)
702702
)
703703

704-
def resin_tip_unseal(
705-
self, location: Location, well_core: WellCore, home_after: Optional[bool]
706-
) -> None:
704+
def resin_tip_unseal(self, location: Location, well_core: WellCore) -> None:
707705
well_name = well_core.get_name()
708706
labware_id = well_core.labware_id
709707

@@ -736,7 +734,6 @@ def resin_tip_unseal(
736734
labwareId=labware_id,
737735
wellName=well_name,
738736
wellLocation=well_location,
739-
homeAfter=home_after,
740737
)
741738
)
742739

@@ -790,7 +787,6 @@ def resin_tip_dispense(
790787
wellLocation=well_location,
791788
volume=volume,
792789
flowRate=flow_rate,
793-
pushOut=push_out,
794790
)
795791
)
796792

api/src/opentrons/protocol_api/core/instrument.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ def resin_tip_unseal(
195195
self,
196196
location: types.Location,
197197
well_core: WellCoreType,
198-
home_after: Optional[bool],
199198
) -> None:
200199
...
201200

api/src/opentrons/protocol_api/core/legacy/legacy_instrument_core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,6 @@ def resin_tip_unseal(
320320
self,
321321
location: types.Location,
322322
well_core: WellCore,
323-
home_after: Optional[bool],
324323
) -> None:
325324
raise APIVersionError(api_element="Unsealing resin tips.")
326325

@@ -333,7 +332,7 @@ def resin_tip_dispense(
333332
push_out: Optional[float] = None,
334333
) -> None:
335334
raise APIVersionError(api_element="Dispensing liquid from resin tips.")
336-
335+
337336
def home(self) -> None:
338337
"""Home the mount"""
339338
self._protocol_interface.get_hardware().home_z(

api/src/opentrons/protocol_api/core/legacy_simulator/legacy_instrument_core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ def resin_tip_unseal(
288288
self,
289289
location: types.Location,
290290
well_core: WellCore,
291-
home_after: Optional[bool],
292291
) -> None:
293292
raise APIVersionError(api_element="Unsealing resin tips.")
294293

@@ -301,7 +300,7 @@ def resin_tip_dispense(
301300
push_out: Optional[float] = None,
302301
) -> None:
303302
raise APIVersionError(api_element="Dispensing liquid from resin tips.")
304-
303+
305304
def home(self) -> None:
306305
self._protocol_interface.set_last_location(None)
307306

api/src/opentrons/protocol_api/instrument_context.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,7 +1751,6 @@ def resin_tip_seal(
17511751
def resin_tip_unseal(
17521752
self,
17531753
location: Union[labware.Well, labware.Labware],
1754-
home_after: Optional[bool] = None,
17551754
) -> InstrumentContext:
17561755
"""Release resin tips from the pipette.
17571756
@@ -1784,9 +1783,7 @@ def resin_tip_unseal(
17841783
location=well,
17851784
),
17861785
):
1787-
self._core.evotip_unseal(
1788-
location=well.top(), well_core=well._core, home_after=home_after
1789-
)
1786+
self._core.resin_tip_unseal(location=well.top(), well_core=well._core)
17901787

17911788
return self
17921789

api/src/opentrons/protocol_engine/commands/evotip_dispense.py

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,7 @@ class EvotipDispenseParams(
4444
):
4545
"""Payload required to dispense in place."""
4646

47-
pushOut: Optional[float] = Field(
48-
None,
49-
description="Push the plunger a small amount farther than necessary for accurate low-volume dispensing",
50-
)
47+
pass
5148

5249

5350
class EvotipDispenseResult(BaseLiquidHandlingResult):
@@ -110,7 +107,7 @@ async def execute(self, params: EvotipDispenseParams) -> _ExecuteReturn:
110107
pipette_id=params.pipetteId,
111108
volume=params.volume,
112109
flow_rate=params.flowRate,
113-
push_out=params.pushOut,
110+
push_out=None,
114111
location_if_error={
115112
"retryLocation": (
116113
current_position.x,
@@ -122,38 +119,10 @@ async def execute(self, params: EvotipDispenseParams) -> _ExecuteReturn:
122119
model_utils=self._model_utils,
123120
)
124121

125-
if (
126-
isinstance(current_location, CurrentWell)
127-
and current_location.pipette_id == params.pipetteId
128-
):
129-
volume_added = (
130-
self._state_view.pipettes.get_liquid_dispensed_by_ejecting_volume(
131-
pipette_id=params.pipetteId, volume=result.public.volume
132-
)
133-
)
134-
if volume_added is not None:
135-
volume_added *= self._state_view.geometry.get_nozzles_per_well(
136-
current_location.labware_id,
137-
current_location.well_name,
138-
params.pipetteId,
139-
)
140-
return SuccessData(
141-
public=EvotipDispenseResult(volume=result.public.volume),
142-
state_update=result.state_update.set_liquid_operated(
143-
labware_id=current_location.labware_id,
144-
well_names=self._state_view.geometry.get_wells_covered_by_pipette_with_active_well(
145-
current_location.labware_id,
146-
current_location.well_name,
147-
params.pipetteId,
148-
),
149-
volume_added=volume_added if volume_added is not None else CLEAR,
150-
),
151-
)
152-
else:
153-
return SuccessData(
154-
public=EvotipDispenseResult(volume=result.public.volume),
155-
state_update=result.state_update,
156-
)
122+
return SuccessData(
123+
public=EvotipDispenseResult(volume=result.public.volume),
124+
state_update=result.state_update,
125+
)
157126

158127

159128
class EvotipDispense(

0 commit comments

Comments
 (0)