Skip to content

Commit

Permalink
merge edge
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyaochen authored and shiyaochen committed Jan 30, 2025
2 parents 1be39c1 + b1684cb commit 2cd3b68
Show file tree
Hide file tree
Showing 206 changed files with 7,413 additions and 2,641 deletions.
4 changes: 2 additions & 2 deletions api-client/src/maintenance_runs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
} from '@opentrons/shared-data'
import type {
RunCommandSummary,
LabwareOffsetCreateData,
LegacyLabwareOffsetCreateData,
RunStatus,
RunAction,
} from '../runs'
Expand Down Expand Up @@ -42,7 +42,7 @@ export interface MaintenanceRunError {
}

export interface CreateMaintenanceRunData {
labwareOffsets?: LabwareOffsetCreateData[]
labwareOffsets?: LegacyLabwareOffsetCreateData[]
}

export interface LabwareDefinitionSummary {
Expand Down
1 change: 1 addition & 0 deletions api-client/src/modules/api-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ interface PhysicalPort {
port: number
hub: boolean
portGroup: PortGroup
hubPort?: number
}

type ModuleOffsetSource =
Expand Down
6 changes: 3 additions & 3 deletions api-client/src/runs/createLabwareOffset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { POST, request } from '../request'

import type { ResponsePromise } from '../request'
import type { HostConfig } from '../types'
import type { LabwareOffsetCreateData, Run } from './types'
import type { LegacyLabwareOffsetCreateData, Run } from './types'

export function createLabwareOffset(
config: HostConfig,
runId: string,
data: LabwareOffsetCreateData
data: LegacyLabwareOffsetCreateData
): ResponsePromise<Run> {
return request<Run, { data: LabwareOffsetCreateData }>(
return request<Run, { data: LegacyLabwareOffsetCreateData }>(
POST,
`/runs/${runId}/labware_offsets`,
{ data },
Expand Down
4 changes: 2 additions & 2 deletions api-client/src/runs/createRun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import type { ResponsePromise } from '../request'
import type { HostConfig } from '../types'
import type {
Run,
LabwareOffsetCreateData,
LegacyLabwareOffsetCreateData,
RunTimeParameterValuesCreateData,
RunTimeParameterFilesCreateData,
} from './types'

export interface CreateRunData {
protocolId?: string
labwareOffsets?: LabwareOffsetCreateData[]
labwareOffsets?: LegacyLabwareOffsetCreateData[]
runTimeParameterValues?: RunTimeParameterValuesCreateData
runTimeParameterFiles?: RunTimeParameterFilesCreateData
}
Expand Down
30 changes: 26 additions & 4 deletions api-client/src/runs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ export interface LabwareOffset {
id: string
createdAt: string
definitionUri: string
location: LabwareOffsetLocation
location: LegacyLabwareOffsetLocation
locationSequence?: LabwareOffsetLocationSequence
vector: VectorOffset
}

Expand Down Expand Up @@ -156,14 +157,35 @@ export interface CreateRunActionData {
actionType: RunActionType
}

export interface LabwareOffsetLocation {
export interface OnAddressableAreaLabwareOffsetLocationSequenceComponent {
kind: 'onAddressableArea'
labware: string
}

export interface OnModuleOffsetLocationSequenceComponent {
kind: 'onModule'
moduleModel: ModuleModel
}

export interface OnLabwareOffsetLocationSequenceComponent {
kind: 'onLabware'
labwareUri: string
}

export type LabwareOffsetLocationSequenceComponent =
| OnAddressableAreaLabwareOffsetLocationSequenceComponent
| OnModuleOffsetLocationSequenceComponent
| OnLabwareOffsetLocationSequenceComponent
export type LabwareOffsetLocationSequence = LabwareOffsetLocationSequenceComponent[]

export interface LegacyLabwareOffsetLocation {
slotName: string
moduleModel?: ModuleModel
definitionUri?: string
}
export interface LabwareOffsetCreateData {
export interface LegacyLabwareOffsetCreateData {
definitionUri: string
location: LabwareOffsetLocation
location: LegacyLabwareOffsetLocation
vector: VectorOffset
}

Expand Down
49 changes: 26 additions & 23 deletions api/docs/v2/pipettes/characteristics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,29 +184,32 @@ These flow rates will remain in effect until you change the ``flow_rate`` attrib
Flex Pipette Flow Rates
-----------------------

Flex pipette flow rates depend on pipette volume and tip capacity. Each pipette–tip combination has a default flow rate for aspirating, dispensing, and blowing out liquid. When using a 50 µL pipette, you should only use 50 µL tips.

.. list-table::
:header-rows: 1

* - Pipette Model
- Tip Capacity (µL)
- Flow Rate (µL/s)
* - 50 µL (1- and 8-channel)
- 50
- 57
* - 1000 µL (1-, 8-, and 96-channel)
- 50
- 478
* - 1000 µL (1-, 8-, and 96-channel)
- 200
- 716
* - 1000 µL (1-, 8-, and 96-channel)
- 1000
- 716


Additionally, all Flex pipettes have a well bottom clearance of 1 mm for aspirate and dispense actions.
The following table provides data on the default aspirate, dispense, and blowout flow rates (in µL/s) for Flex pipettes. Default flow rates for each pipette-tip combination are the same across all three actions.

.. Excludes low-vol 96 channel. Not yet released.
+-----------------------------+-------------------+------------------------+
| Pipette Model | Tip Capacity (µL) | Default Flow Rate (µL) |
+=============================+===================+========================+
| 1- and 8-channel (50 µL) | 50 | 35 |
+-----------------------------+-------------------+------------------------+
| 1- and 8-channel (1000 µL) | 50 | 478 |
+ +-------------------+------------------------+
| | 200 | 716 |
+ +-------------------+------------------------+
| | 1000 | 716 |
+-----------------------------+-------------------+------------------------+
| 96-channel (5-1000 µL) | 50 | 6 |
+ +-------------------+------------------------+
| | 200 | 80 |
+ +-------------------+------------------------+
| | 1000 | 160 |
+-----------------------------+-------------------+------------------------+

Additionally:

- When using a 50 µL pipette, you should only use 50 µL tips.
- All Flex pipettes have a well bottom clearance of 1 mm for aspirate and dispense actions.

.. _ot2-flow-rates:

Expand Down
9 changes: 9 additions & 0 deletions api/release-notes-internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@ For more details about this release, please see the full [technical change log][

[technical change log]: https://github.com/Opentrons/opentrons/releases

## Internal Release 2.4.0-alpha.1

This internal release, pulled from the `edge` branch, contains features being developed for 8.4.0. It's for internal testing only.

### New Stuff In This Release (list in progress):

- Python API version bumped to 2.23
- Added liquid classes and new transfer functions

## Internal Release 2.3.0-alpha.2

This internal release, pulled from the `edge` branch, contains features being developed for 8.3.0. It's for internal testing only.
Expand Down
20 changes: 9 additions & 11 deletions api/src/opentrons/config/advanced_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,6 @@ class Setting(NamedTuple):
robot_type=[RobotTypeEnum.OT2, RobotTypeEnum.FLEX],
internal_only=True,
),
SettingDefinition(
_id="allowLiquidClasses",
title="Allow the use of liquid classes",
description=(
"Do not enable."
" This is an Opentrons internal setting to allow using in-development"
" liquid classes."
),
robot_type=[RobotTypeEnum.OT2, RobotTypeEnum.FLEX],
internal_only=True,
),
]


Expand Down Expand Up @@ -736,6 +725,14 @@ def _migrate35to36(previous: SettingsMap) -> SettingsMap:
return newmap


def _migrate36to37(previous: SettingsMap) -> SettingsMap:
"""Migrate to version 37 of the feature flags file.
- Removes the allowLiquidClasses flag.
"""
return {k: v for k, v in previous.items() if "allowLiquidClasses" != k}


_MIGRATIONS = [
_migrate0to1,
_migrate1to2,
Expand Down Expand Up @@ -773,6 +770,7 @@ def _migrate35to36(previous: SettingsMap) -> SettingsMap:
_migrate33to34,
_migrate34to35,
_migrate35to36,
_migrate36to37,
]
"""
List of all migrations to apply, indexed by (version - 1). See _migrate below
Expand Down
4 changes: 0 additions & 4 deletions api/src/opentrons/config/feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,3 @@ def enable_performance_metrics(robot_type: RobotTypeEnum) -> bool:

def oem_mode_enabled() -> bool:
return advs.get_setting_with_env_overload("enableOEMMode", RobotTypeEnum.FLEX)


def allow_liquid_classes(robot_type: RobotTypeEnum) -> bool:
return advs.get_setting_with_env_overload("allowLiquidClasses", robot_type)
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ def reset_input_buffer(self) -> None:
"""Reset the input buffer"""
self._serial.reset_input_buffer()

def reset_output_buffer(self) -> None:
"""Reset the output buffer"""
self._serial.reset_output_buffer()

@contextlib.asynccontextmanager
async def timeout_override(
self, timeout_property: TimeoutProperties, timeout: Optional[float]
Expand Down
7 changes: 7 additions & 0 deletions api/src/opentrons/drivers/asyncio/communication/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class ErrorCodes(Enum):
UNHANDLED_GCODE = "ERR003"
MOTOR_STALL = "ERR403"


class SerialException(Exception):
Expand Down Expand Up @@ -43,3 +44,9 @@ class UnhandledGcode(ErrorResponse):
def __init__(self, port: str, response: str, command: str) -> None:
self.command = command
super().__init__(port, response)


class MotorStall(ErrorResponse):
def __init__(self, port: str, response: str, command: str) -> None:
self.command = command
super().__init__(port, response)
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@

from opentrons.drivers.command_builder import CommandBuilder

from .errors import NoResponse, AlarmResponse, ErrorResponse, UnhandledGcode, ErrorCodes
from .errors import (
MotorStall,
NoResponse,
AlarmResponse,
ErrorResponse,
UnhandledGcode,
ErrorCodes,
)
from .async_serial import AsyncSerial

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -254,6 +261,9 @@ def raise_on_error(self, response: str, request: str) -> None:
raise UnhandledGcode(
port=self._port, response=response, command=request
)

elif ErrorCodes.MOTOR_STALL.value.lower() in lower:
raise MotorStall(port=self._port, response=response, command=request)
else:
raise ErrorResponse(port=self._port, response=response)

Expand Down
3 changes: 2 additions & 1 deletion api/src/opentrons/drivers/flex_stacker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .abstract import AbstractFlexStackerDriver
from .driver import FlexStackerDriver, STACKER_MOTION_CONFIG
from .driver import FlexStackerDriver, STACKER_MOTION_CONFIG, STALLGUARD_CONFIG
from .simulator import SimulatingDriver
from . import types as FlexStackerTypes

Expand All @@ -9,4 +9,5 @@
"SimulatingDriver",
"FlexStackerTypes",
"STACKER_MOTION_CONFIG",
"STALLGUARD_CONFIG",
]
40 changes: 36 additions & 4 deletions api/src/opentrons/drivers/flex_stacker/abstract.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import List, Protocol
from typing import List, Optional, Protocol

from .types import (
LEDPattern,
LimitSwitchStatus,
MoveResult,
StackerAxis,
Expand All @@ -9,6 +10,7 @@
MoveParams,
StackerInfo,
LEDColor,
StallGuardParams,
)


Expand Down Expand Up @@ -51,10 +53,30 @@ async def set_ihold_current(self, axis: StackerAxis, current: float) -> bool:
"""Set axis hold current in amps."""
...

async def set_stallguard_threshold(
self, axis: StackerAxis, enable: bool, threshold: int
) -> bool:
"""Enables and sets the stallguard threshold for the given axis motor."""
...

async def set_motor_driver_register(
self, axis: StackerAxis, reg: int, value: int
) -> bool:
"""Set the register of the given motor axis driver to the given value."""
...

async def get_motor_driver_register(self, axis: StackerAxis, reg: int) -> int:
"""Gets the register value of the given motor axis driver."""
...

async def get_motion_params(self, axis: StackerAxis) -> MoveParams:
"""Get the motion parameters used by the given axis motor."""
...

async def get_stallguard_threshold(self, axis: StackerAxis) -> StallGuardParams:
"""Get the stallguard parameters by the given axis motor."""
...

async def get_limit_switch(self, axis: StackerAxis, direction: Direction) -> bool:
"""Get limit switch status.
Expand Down Expand Up @@ -96,16 +118,26 @@ async def move_to_limit_switch(
"""Move until limit switch is triggered."""
...

async def home_axis(self, axis: StackerAxis, direction: Direction) -> bool:
async def home_axis(self, axis: StackerAxis, direction: Direction) -> MoveResult:
"""Home axis."""
...

async def set_led(
self, power: float, color: LEDColor | None = None, external: bool | None = None
self,
power: float,
color: Optional[LEDColor] = None,
external: Optional[bool] = None,
pattern: Optional[LEDPattern] = None,
duration: Optional[int] = None,
reps: Optional[int] = None,
) -> bool:
"""Set LED color of status bar."""
"""Set LED Status bar color and pattern."""
...

async def enter_programming_mode(self) -> None:
"""Reboot into programming mode"""
...

def reset_serial_buffers(self) -> None:
"""Reset the input and output serial buffers."""
...
Loading

0 comments on commit 2cd3b68

Please sign in to comment.