Skip to content

Commit

Permalink
Merge branch 'chore_release-8.0.0' into invalid_liquid_class_bug_pipe…
Browse files Browse the repository at this point in the history
…tte_mismatch_fix
  • Loading branch information
CaseyBatten committed Aug 12, 2024
2 parents 294e091 + 1201666 commit 8e1e2dc
Show file tree
Hide file tree
Showing 194 changed files with 4,817 additions and 1,827 deletions.
12 changes: 12 additions & 0 deletions api-client/src/dataFiles/getCsvFile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { GET, request } from '../request'

import type { CsvFileDataResponse } from './types'
import type { ResponsePromise } from '../request'
import type { HostConfig } from '../types'

export function getCsvFile(
config: HostConfig,
fileId: string
): ResponsePromise<CsvFileDataResponse> {
return request<CsvFileDataResponse>(GET, `/dataFiles/${fileId}`, null, config)
}
1 change: 1 addition & 0 deletions api-client/src/dataFiles/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { getCsvFile } from './getCsvFile'
export { getCsvFileRaw } from './getCsvFileRaw'
export { uploadCsvFile } from './uploadCsvFile'

Expand Down
4 changes: 3 additions & 1 deletion api-client/src/dataFiles/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ export interface CsvFileData {
name: string
}

export interface UploadedCsvFileResponse {
export interface CsvFileDataResponse {
data: CsvFileData
}

export type UploadedCsvFileResponse = CsvFileDataResponse

export interface UploadedCsvFilesResponse {
data: CsvFileData[]
}
Expand Down
19 changes: 19 additions & 0 deletions api-client/src/runs/commands/getRunCommandErrors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { GET, request } from '../../request'

import type { ResponsePromise } from '../../request'
import type { HostConfig } from '../../types'
import type { GetCommandsParams, RunCommandErrors } from '../types'

export function getRunCommandErrors(
config: HostConfig,
runId: string,
params: GetCommandsParams
): ResponsePromise<RunCommandErrors> {
return request<RunCommandErrors>(
GET,
`/runs/${runId}/commandErrors`,
null,
config,
params
)
}
7 changes: 6 additions & 1 deletion api-client/src/runs/commands/types.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import type { RunTimeCommand } from '@opentrons/shared-data'
import type { RunTimeCommand, RunCommandError } from '@opentrons/shared-data'

export interface GetCommandsParams {
cursor: number | null // the index of the command at the center of the window
pageLength: number // the number of items to include
}

export interface RunCommandErrors {
data: RunCommandError[]
meta: GetCommandsParams & { totalLength: number }
}

// NOTE: this incantation allows us to omit a key from each item in a union distributively
// this means we can, for example, maintain the associated commandType and params after the Omit is applied
type DistributiveOmit<T, K extends keyof T> = T extends any ? Omit<T, K> : never
Expand Down
1 change: 1 addition & 0 deletions api-client/src/runs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { getCommand } from './commands/getCommand'
export { getCommands } from './commands/getCommands'
export { getCommandsAsPreSerializedList } from './commands/getCommandsAsPreSerializedList'
export { createRunAction } from './createRunAction'
export { getRunCommandErrors } from './commands/getRunCommandErrors'
export * from './createLabwareOffset'
export * from './createLabwareDefinition'
export * from './constants'
Expand Down
2 changes: 1 addition & 1 deletion api-client/src/runs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export interface LegacyGoodRunData {
modules: LoadedModule[]
protocolId?: string
labwareOffsets?: LabwareOffset[]
runTimeParameters: RunTimeParameter[]
}

export interface KnownGoodRunData extends LegacyGoodRunData {
ok: true
runTimeParameters: RunTimeParameter[]
}

export interface KnownInvalidRunData extends LegacyGoodRunData {
Expand Down
5 changes: 5 additions & 0 deletions api/docs/v2/versioning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ This table lists the correspondence between Protocol API versions and robot soft
Changes in API Versions
=======================

Version 2.20
------------

- You can now call :py:obj:`.ProtocolContext.define_liquid()` without supplying a ``description`` or ``display_color``.

Version 2.19
------------

Expand Down
20 changes: 20 additions & 0 deletions api/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ log][]. For a list of currently known issues, please see the [Opentrons issue tr
[technical change log]: https://github.com/Opentrons/opentrons/releases
[opentrons issue tracker]: https://github.com/Opentrons/opentrons/issues?q=is%3Aopen+is%3Aissue+label%3Abug

By installing and using Opentrons software, you agree to the Opentrons End-User License Agreement (EULA). You can view the EULA at [opentrons.com/eula](https://opentrons.com/eula).

---

## Opentrons Robot Software Changes in 8.0.0

Welcome to the v8.0.0 release of the Opentrons robot software!

### New Features

- Create, store, and run quick transfers on Flex.
- Define and use CSV runtime parameters in Python protocols.
- Detect the presence or absence of liquid in a well (Flex pipettes only), and continue or pause the protocol based on the result.
- Automatically pause Flex protocol runs when detecting overpressure, allowing for error recovery and run resumption.

### Improved Features

- Provides more partial tip pickup configurations. All multi-channel pipettes now support single and partial column pickup, and the Flex 96-channel pipette now supports row pickup.
- Improves homing behavior when a Flex protocol completes or is canceled with liquid-filled tips attached to the pipette.

---

## Opentrons Robot Software Changes in 7.5.0
Expand Down
74 changes: 37 additions & 37 deletions api/src/opentrons/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,23 +142,23 @@ def get_protocol_api(
When this function is called, modules and instruments will be recached.
:param version: The API version to use. This must be lower than
``opentrons.protocol_api.MAX_SUPPORTED_VERSION``.
It may be specified either as a string (``'2.0'``) or
as a ``protocols.types.APIVersion``
(``APIVersion(2, 0)``).
``opentrons.protocol_api.MAX_SUPPORTED_VERSION``.
It may be specified either as a string (``'2.0'``) or
as a ``protocols.types.APIVersion``
(``APIVersion(2, 0)``).
:param bundled_labware: If specified, a mapping from labware names to
labware definitions for labware to consider in the
protocol. Note that if you specify this, _only_
labware in this argument will be allowed in the
protocol. This is preparation for a beta feature
and is best not used.
labware definitions for labware to consider in the
protocol. Note that if you specify this, *only*
labware in this argument will be allowed in the
protocol. This is preparation for a beta feature
and is best not used.
:param bundled_data: If specified, a mapping from filenames to contents
for data to be available in the protocol from
:py:obj:`opentrons.protocol_api.ProtocolContext.bundled_data`.
for data to be available in the protocol from
:py:obj:`opentrons.protocol_api.ProtocolContext.bundled_data`.
:param extra_labware: A mapping from labware load names to custom labware definitions.
If this is ``None`` (the default), and this function is called on a robot,
it will look for labware in the ``labware`` subdirectory of the Jupyter
data directory.
If this is ``None`` (the default), and this function is called on a robot,
it will look for labware in the ``labware`` subdirectory of the Jupyter
data directory.
:return: The protocol context.
"""
if isinstance(version, str):
Expand Down Expand Up @@ -313,18 +313,18 @@ def execute(
:param protocol_file: The protocol file to execute
:param protocol_name: The name of the protocol file. This is required
internally, but it may not be a thing we can get
from the protocol_file argument.
internally, but it may not be a thing we can get
from the ``protocol_file`` argument.
:param propagate_logs: Whether this function should allow logs from the
Opentrons stack to propagate up to the root handler.
This can be useful if you're integrating this
function in a larger application, but most logs that
occur during protocol simulation are best associated
with the actions in the protocol that cause them.
Default: ``False``
Opentrons stack to propagate up to the root handler.
This can be useful if you're integrating this
function in a larger application, but most logs that
occur during protocol simulation are best associated
with the actions in the protocol that cause them.
Default: ``False``
:param log_level: The level of logs to emit on the command line:
``"debug"``, ``"info"``, ``"warning"``, or ``"error"``.
Defaults to ``"warning"``.
``"debug"``, ``"info"``, ``"warning"``, or ``"error"``.
Defaults to ``"warning"``.
:param emit_runlog: A callback for printing the run log. If specified, this
will be called whenever a command adds an entry to the
run log, which can be used for display and progress
Expand Down Expand Up @@ -353,17 +353,17 @@ def execute(
``KeyError``.
:param custom_labware_paths: A list of directories to search for custom labware.
Loads valid labware from these paths and makes them available
to the protocol context. If this is ``None`` (the default), and
this function is called on a robot, it will look in the ``labware``
subdirectory of the Jupyter data directory.
Loads valid labware from these paths and makes them available
to the protocol context. If this is ``None`` (the default), and
this function is called on a robot, it will look in the ``labware``
subdirectory of the Jupyter data directory.
:param custom_data_paths: A list of directories or files to load custom
data files from. Ignored if the apiv2 feature
flag if not set. Entries may be either files or
directories. Specified files and the
non-recursive contents of specified directories
are presented by the protocol context in
``ProtocolContext.bundled_data``.
data files from. Ignored if the apiv2 feature
flag if not set. Entries may be either files or
directories. Specified files and the
non-recursive contents of specified directories
are presented by the protocol context in
``ProtocolContext.bundled_data``.
"""
stack_logger = logging.getLogger("opentrons")
stack_logger.propagate = propagate_logs
Expand Down Expand Up @@ -457,10 +457,10 @@ def main() -> int:
"""Handler for command line invocation to run a protocol.
:param argv: The arguments the program was invoked with; this is usually
:py:obj:`sys.argv` but if you want to override that you can.
:py:obj:`sys.argv` but if you want to override that you can.
:returns int: A success or failure value suitable for use as a shell
return code passed to :py:obj:`sys.exit` (0 means success,
anything else is a kind of failure).
return code passed to :py:obj:`sys.exit` (0 means success,
anything else is a kind of failure).
"""
parser = argparse.ArgumentParser(
prog="opentrons_execute", description="Run an OT-2 protocol"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ async def _status_bar_software_error(self) -> None:
if self._enabled:
await self._controller.static_color(status_bar.YELLOW)

async def _status_bar_error_recovery(self) -> None:
self._status_bar_state = StatusBarState.ERROR_RECOVERY
if self._enabled:
await self._controller.pulse_color(status_bar.YELLOW)

async def _status_bar_confirm(self) -> None:
# Confirm should revert to IDLE
self._status_bar_state = StatusBarState.IDLE
Expand Down Expand Up @@ -163,6 +168,7 @@ async def set_status_bar_state(self, state: StatusBarState) -> None:
StatusBarState.PAUSED: self._status_bar_paused,
StatusBarState.HARDWARE_ERROR: self._status_bar_hardware_error,
StatusBarState.SOFTWARE_ERROR: self._status_bar_software_error,
StatusBarState.ERROR_RECOVERY: self._status_bar_error_recovery,
StatusBarState.CONFIRMATION: self._status_bar_confirm,
StatusBarState.RUN_COMPLETED: self._status_bar_run_complete,
StatusBarState.UPDATING: self._status_bar_updating,
Expand Down
22 changes: 17 additions & 5 deletions api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2629,7 +2629,7 @@ async def _liquid_probe_pass(
force_both_sensors: bool = False,
) -> float:
plunger_direction = -1 if probe_settings.aspirate_while_sensing else 1
await self._backend.liquid_probe(
end_z = await self._backend.liquid_probe(
mount,
p_travel,
probe_settings.mount_speed,
Expand All @@ -2641,8 +2641,17 @@ async def _liquid_probe_pass(
probe=probe,
force_both_sensors=force_both_sensors,
)
end_pos = await self.gantry_position(mount, refresh=True)
return end_pos.z
machine_pos = await self._backend.update_position()
machine_pos[Axis.by_mount(mount)] = end_z
deck_end_z = self._deck_from_machine(machine_pos)[Axis.by_mount(mount)]
offset = offset_for_mount(
mount,
top_types.Point(*self._config.left_mount_offset),
top_types.Point(*self._config.right_mount_offset),
top_types.Point(*self._config.gripper_mount_offset),
)
cp = self.critical_point_for(mount, None)
return deck_end_z + offset.z + cp.z

async def liquid_probe(
self,
Expand Down Expand Up @@ -2714,7 +2723,10 @@ async def liquid_probe(

error: Optional[PipetteLiquidNotFoundError] = None
pos = await self.gantry_position(checked_mount, refresh=True)
while (probe_start_pos.z - pos.z) < max_z_dist:
# probe_start_pos.z + z_distance of pass - pos.z should be < max_z_dist
# due to rounding errors this can get caught in an infinite loop when the distance is almost equal
# so we check to see if they're within 0.01 which is 1/5th the minimum movement distance from move_utils.py
while (probe_start_pos.z - pos.z) < (max_z_dist - 0.01):
# safe distance so we don't accidentally aspirate liquid if we're already close to liquid
safe_plunger_pos = top_types.Point(
pos.x, pos.y, pos.z + probe_safe_reset_mm
Expand All @@ -2724,7 +2736,7 @@ async def liquid_probe(
pos.x, pos.y, pos.z + probe_pass_z_offset_mm
)
max_z_time = (
max_z_dist - (probe_start_pos.z - safe_plunger_pos.z)
max_z_dist - probe_start_pos.z + pass_start_pos.z
) / probe_settings.mount_speed
p_travel_required_for_z = max_z_time * probe_settings.plunger_speed
p_pass_travel = min(p_travel_required_for_z, p_working_mm)
Expand Down
28 changes: 17 additions & 11 deletions api/src/opentrons/hardware_control/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,17 +572,23 @@ class PauseType(enum.Enum):


class StatusBarState(enum.Enum):
IDLE = 0
RUNNING = 1
PAUSED = 2
HARDWARE_ERROR = 3
SOFTWARE_ERROR = 4
CONFIRMATION = 5
RUN_COMPLETED = 6
UPDATING = 7
ACTIVATION = 8
DISCO = 9
OFF = 10
"""Semantic status bar states.
These mostly correspond to cases listed out in the Flex manual.
"""

IDLE = enum.auto()
RUNNING = enum.auto()
PAUSED = enum.auto()
HARDWARE_ERROR = enum.auto()
SOFTWARE_ERROR = enum.auto()
ERROR_RECOVERY = enum.auto()
CONFIRMATION = enum.auto()
RUN_COMPLETED = enum.auto()
UPDATING = enum.auto()
ACTIVATION = enum.auto()
DISCO = enum.auto()
OFF = enum.auto()

def transient(self) -> bool:
return self.value in {
Expand Down
2 changes: 1 addition & 1 deletion api/src/opentrons/protocol_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from opentrons.protocols.parameters.exceptions import (
RuntimeParameterRequired as RuntimeParameterRequiredError,
)
from opentrons.protocols.parameters.types import CSVParameter
from opentrons.protocols.parameters.csv_parameter_interface import CSVParameter

from .protocol_context import ProtocolContext
from .deck import Deck
Expand Down
Loading

0 comments on commit 8e1e2dc

Please sign in to comment.