Skip to content

Commit

Permalink
fix(app, api): expose failOnNotHomed parameter for save_position command
Browse files Browse the repository at this point in the history
Drop tip flows require saving pipette positions without homing the plunger axis (we definitely do
not want to home the plunger). The save_position command should optionally expose a failOnNotHomed
parameter to prevent an error from being thrown when the plunger is not homed.
  • Loading branch information
mjhuff committed Dec 7, 2023
1 parent 7e765eb commit b5eeb4e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion api/src/opentrons/protocol_engine/commands/save_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class SavePositionParams(BaseModel):
description="An optional ID to assign to this command instance. "
"Auto-assigned if not defined.",
)
failOnNotHomed: bool = Field(
True, descrption="Require all axes to be homed before saving position."
)


class SavePositionResult(BaseModel):
Expand Down Expand Up @@ -59,7 +62,7 @@ async def execute(self, params: SavePositionParams) -> SavePositionResult:
"""Check the requested pipette's current position."""
position_id = self._model_utils.ensure_id(params.positionId)
x, y, z = await self._gantry_mover.get_position(
pipette_id=params.pipetteId, fail_on_not_homed=True
pipette_id=params.pipetteId, fail_on_not_homed=params.failOnNotHomed
)

return SavePositionResult(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ async def test_save_position_implementation(
subject = SavePositionImplementation(
model_utils=mock_model_utils, gantry_mover=mock_gantry_mover
)
params = SavePositionParams(
pipetteId="abc",
positionId="123",
)
params = SavePositionParams(pipetteId="abc", positionId="123", failOnNotHomed=True)

decoy.when(mock_model_utils.ensure_id("123")).then_return("456")

Expand Down
1 change: 1 addition & 0 deletions app/src/organisms/DropTipWizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ export const DropTipWizardComponent = (
commandType: 'savePosition' as const,
params: {
pipetteId: MANAGED_PIPETTE_ID,
failOnNotHomed: false,
},
},
]
Expand Down
1 change: 1 addition & 0 deletions shared-data/command/types/gantry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ interface MoveRelativeParams {
interface SavePositionParams {
pipetteId: string // pipette to use in measurement
positionId?: string // position ID, auto-assigned if left blank
failOnNotHomed?: boolean // Defaults to true if blank. Require every possible axis to be homed to save.
}

interface HomeParams {
Expand Down

0 comments on commit b5eeb4e

Please sign in to comment.