Skip to content

Commit

Permalink
Merge branch 'edge' into EXEC-640-LIQUIDSURFACE-wellOrigin
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed Sep 16, 2024
2 parents 9a6e7f3 + a0ea43d commit 73174ba
Show file tree
Hide file tree
Showing 150 changed files with 2,631 additions and 1,463 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pd-test-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ jobs:
OT_PD_MIXPANEL_ID: ${{ secrets.OT_PD_MIXPANEL_ID }}
OT_PD_MIXPANEL_DEV_ID: ${{ secrets.OT_PD_MIXPANEL_DEV_ID }}
run: |
make -C protocol-designer
make -C protocol-designer NODE_ENV=development
- name: 'upload github artifact'
uses: actions/upload-artifact@v3
with:
Expand Down Expand Up @@ -215,4 +215,7 @@ jobs:
aws configure set role_arn ${{ secrets.OT_PD_DEPLOY_ROLE }} --profile deploy
aws configure set source_profile identity --profile deploy
aws s3 sync ./dist s3://sandbox.designer.opentrons.com/${{ env.OT_BRANCH }} --acl=public-read --profile=deploy
# invalidate both sandbox.opentrons.com and www.sandbox.opentrons.com cloudfront caches
aws cloudfront create-invalidation --distribution-id ${{ secrets.PD_CLOUDFRONT_SANDBOX_DISTRIBUTION_ID }} --paths "/*" --profile deploy
aws cloudfront create-invalidation --distribution-id ${{ secrets.PD_CLOUDFRONT_SANDBOX_WWW_DISTRIBUTION_ID }} --paths "/*" --profile deploy
shell: bash
4 changes: 2 additions & 2 deletions api-client/src/runs/commands/getCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { GET, request } from '../../request'
import type { ResponsePromise } from '../../request'
import type { HostConfig } from '../../types'
import type { CommandsData } from '..'
import type { GetCommandsParams } from './types'
import type { GetRunCommandsParamsRequest } from './types'

export function getCommands(
config: HostConfig,
runId: string,
params: GetCommandsParams
params: GetRunCommandsParamsRequest
): ResponsePromise<CommandsData> {
return request<CommandsData>(
GET,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { ResponsePromise } from '../../request'
import type { HostConfig } from '../../types'
import type {
CommandsAsPreSerializedListData,
GetCommandsParams,
GetRunCommandsParamsRequest,
} from './types'

export function getCommandsAsPreSerializedList(
config: HostConfig,
runId: string,
params: GetCommandsParams
params: GetRunCommandsParamsRequest
): ResponsePromise<CommandsAsPreSerializedListData> {
return request<CommandsAsPreSerializedListData>(
GET,
Expand Down
8 changes: 8 additions & 0 deletions api-client/src/runs/commands/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ export interface GetCommandsParams {
pageLength: number // the number of items to include
}

export interface GetRunCommandsParams extends GetCommandsParams {
includeFixitCommands?: boolean
}

export interface GetRunCommandsParamsRequest extends GetCommandsParams {
includeFixitCommands: boolean | null
}

export interface RunCommandErrors {
data: RunCommandError[]
meta: GetCommandsParams & { totalLength: number }
Expand Down
56 changes: 33 additions & 23 deletions api/src/opentrons/protocol_engine/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Actions can be passed to the ActionDispatcher, where they will trigger
reactions in objects that subscribe to the pipeline, like the StateStore.
"""
from dataclasses import dataclass
import dataclasses
from datetime import datetime
from enum import Enum
from typing import List, Optional, Union
Expand All @@ -22,6 +22,7 @@
)
from ..error_recovery_policy import ErrorRecoveryPolicy, ErrorRecoveryType
from ..notes.notes import CommandNote
from ..state.update_types import StateUpdate
from ..types import (
LabwareOffsetCreate,
ModuleDefinition,
Expand All @@ -31,7 +32,7 @@
)


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class PlayAction:
"""Start or resume processing commands in the engine."""

Expand All @@ -50,28 +51,28 @@ class PauseSource(str, Enum):
PROTOCOL = "protocol"


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class PauseAction:
"""Pause processing commands in the engine."""

source: PauseSource


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class StopAction:
"""Request engine execution to stop soon."""

from_estop: bool = False


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class ResumeFromRecoveryAction:
"""See `ProtocolEngine.resume_from_recovery()`."""

pass


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class FinishErrorDetails:
"""Error details for the payload of a FinishAction or HardwareStoppedAction."""

Expand All @@ -80,7 +81,7 @@ class FinishErrorDetails:
created_at: datetime


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class FinishAction:
"""Gracefully stop processing commands in the engine."""

Expand All @@ -95,7 +96,7 @@ class FinishAction:
"""The fatal error that caused the run to fail."""


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class HardwareStoppedAction:
"""An action dispatched after hardware has been stopped for good, for this engine instance."""

Expand All @@ -105,14 +106,14 @@ class HardwareStoppedAction:
"""The error that happened while doing post-run finish steps (homing and dropping tips)."""


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class DoorChangeAction:
"""Handle events coming in from hardware control."""

door_state: DoorState


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class QueueCommandAction:
"""Add a command request to the queue."""

Expand All @@ -123,7 +124,7 @@ class QueueCommandAction:
failed_command_id: Optional[str] = None


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class RunCommandAction:
"""Mark a given command as running.
Expand All @@ -135,7 +136,7 @@ class RunCommandAction:
started_at: datetime


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class SucceedCommandAction:
"""Mark a given command as succeeded.
Expand All @@ -145,10 +146,19 @@ class SucceedCommandAction:
command: Command
"""The command in its new succeeded state."""

# todo(mm, 2024-08-26): Remove when no state stores use this anymore.
# https://opentrons.atlassian.net/browse/EXEC-639
private_result: CommandPrivateResult

state_update: StateUpdate = dataclasses.field(
# todo(mm, 2024-08-26): This has a default only to make it easier to transition
# old tests while https://opentrons.atlassian.net/browse/EXEC-639 is in
# progress. Make this mandatory when that's completed.
default_factory=StateUpdate
)

@dataclass(frozen=True)

@dataclasses.dataclass(frozen=True)
class FailCommandAction:
"""Mark a given command as failed.
Expand Down Expand Up @@ -196,7 +206,7 @@ class FailCommandAction:
"""The command to fail, in its prior `running` state."""


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class AddLabwareOffsetAction:
"""Add a labware offset, to apply to subsequent `LoadLabwareCommand`s."""

Expand All @@ -205,28 +215,28 @@ class AddLabwareOffsetAction:
request: LabwareOffsetCreate


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class AddLabwareDefinitionAction:
"""Add a labware definition, to apply to subsequent `LoadLabwareCommand`s."""

definition: LabwareDefinition


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class AddLiquidAction:
"""Add a liquid, to apply to subsequent `LoadLiquid`s."""

liquid: Liquid


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class SetDeckConfigurationAction:
"""See `ProtocolEngine.set_deck_configuration()`."""

deck_configuration: Optional[DeckConfigurationType]


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class AddAddressableAreaAction:
"""Add a single addressable area to state.
Expand All @@ -238,7 +248,7 @@ class AddAddressableAreaAction:
addressable_area: AddressableAreaLocation


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class AddModuleAction:
"""Add an attached module directly to state without a location."""

Expand All @@ -248,14 +258,14 @@ class AddModuleAction:
module_live_data: LiveData


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class ResetTipsAction:
"""Reset the tip tracking state of a given tip rack."""

labware_id: str


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class SetPipetteMovementSpeedAction:
"""Set the speed of a pipette's X/Y/Z movements. Does not affect plunger speed.
Expand All @@ -266,7 +276,7 @@ class SetPipetteMovementSpeedAction:
speed: Optional[float]


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class AddAbsorbanceReaderLidAction:
"""Add the absorbance reader lid id to the absorbance reader module substate.
Expand All @@ -277,7 +287,7 @@ class AddAbsorbanceReaderLidAction:
lid_id: str


@dataclass(frozen=True)
@dataclasses.dataclass(frozen=True)
class SetErrorRecoveryPolicyAction:
"""See `ProtocolEngine.set_error_recovery_policy()`."""

Expand Down
24 changes: 14 additions & 10 deletions api/src/opentrons/protocol_engine/commands/aspirate.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from .pipetting_common import (
OverpressureError,
OverpressureErrorInternalData,
PipetteIdMixin,
AspirateVolumeMixin,
FlowRateMixin,
Expand All @@ -25,6 +24,7 @@

from opentrons.hardware_control import HardwareControlAPI

from ..state.update_types import StateUpdate
from ..types import WellLocation, WellOrigin, CurrentWell, DeckPoint

if TYPE_CHECKING:
Expand Down Expand Up @@ -53,7 +53,7 @@ class AspirateResult(BaseLiquidHandlingResult, DestinationPositionResult):

_ExecuteReturn = Union[
SuccessData[AspirateResult, None],
DefinedErrorData[OverpressureError, OverpressureErrorInternalData],
DefinedErrorData[OverpressureError, None],
]


Expand Down Expand Up @@ -92,6 +92,7 @@ async def execute(self, params: AspirateParams) -> _ExecuteReturn:
)

current_well = None
state_update = StateUpdate()

if not ready_to_aspirate:
await self._movement.move_to_well(
Expand All @@ -118,6 +119,13 @@ async def execute(self, params: AspirateParams) -> _ExecuteReturn:
well_location=params.wellLocation,
current_well=current_well,
)
deck_point = DeckPoint.construct(x=position.x, y=position.y, z=position.z)
state_update.set_pipette_location(
pipette_id=pipette_id,
new_labware_id=labware_id,
new_well_name=well_name,
new_deck_point=deck_point,
)

try:
volume_aspirated = await self._pipetting.aspirate_in_place(
Expand All @@ -140,21 +148,17 @@ async def execute(self, params: AspirateParams) -> _ExecuteReturn:
],
errorInfo={"retryLocation": (position.x, position.y, position.z)},
),
private=OverpressureErrorInternalData(
position=DeckPoint.construct(
x=position.x, y=position.y, z=position.z
)
),
private=None,
state_update=state_update,
)
else:
return SuccessData(
public=AspirateResult(
volume=volume_aspirated,
position=DeckPoint.construct(
x=position.x, y=position.y, z=position.z
),
position=deck_point,
),
private=None,
state_update=state_update,
)


Expand Down
12 changes: 2 additions & 10 deletions api/src/opentrons/protocol_engine/commands/aspirate_in_place.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
FlowRateMixin,
BaseLiquidHandlingResult,
OverpressureError,
OverpressureErrorInternalData,
)
from .command import (
AbstractCommandImpl,
Expand All @@ -25,7 +24,6 @@
)
from ..errors.error_occurrence import ErrorOccurrence
from ..errors.exceptions import PipetteNotReadyToAspirateError
from ..types import DeckPoint

if TYPE_CHECKING:
from ..execution import PipettingHandler, GantryMover
Expand All @@ -50,7 +48,7 @@ class AspirateInPlaceResult(BaseLiquidHandlingResult):

_ExecuteReturn = Union[
SuccessData[AspirateInPlaceResult, None],
DefinedErrorData[OverpressureError, OverpressureErrorInternalData],
DefinedErrorData[OverpressureError, None],
]


Expand Down Expand Up @@ -123,13 +121,7 @@ async def execute(self, params: AspirateInPlaceParams) -> _ExecuteReturn:
}
),
),
private=OverpressureErrorInternalData(
position=DeckPoint(
x=current_position.x,
y=current_position.y,
z=current_position.z,
),
),
private=None,
)
else:
return SuccessData(
Expand Down
Loading

0 comments on commit 73174ba

Please sign in to comment.