Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri authored Jul 31, 2024
2 parents ce6dc63 + 36a7501 commit bcec2ec
Show file tree
Hide file tree
Showing 188 changed files with 4,801 additions and 1,045 deletions.
34 changes: 4 additions & 30 deletions api-client/src/protocols/getCsvFiles.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,17 @@
// import { GET, request } from '../request'
import { GET, request } from '../request'

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

/**
export function getCsvFiles(
config: HostConfig,
protocolId: string
): ResponsePromise<UploadCsvFilesResponse> {
return request<UploadCsvFilesResponse>(
): ResponsePromise<UploadedCsvFilesResponse> {
return request<UploadedCsvFilesResponse>(
GET,
`/protocols/${protocolId}/dataFiles`,
null,
config
)
}
*/

// ToDo (kk:06/14/2024) remove when activate the above code
export function getCsvFiles(
config: HostConfig,
protocolId: string
): Promise<{ data: UploadedCsvFilesResponse }> {
const stub = {
data: {
files: [
{
id: '1',
createdAt: '2024-06-07T19:19:56.268029+00:00',
name: 'rtp_mock_file1.csv',
},
{
id: '2',
createdAt: '2024-06-17T19:19:56.268029+00:00',
name: 'rtp_mock_file2.csv',
},
],
},
}
return Promise.resolve({ data: stub })
}
20 changes: 18 additions & 2 deletions api/release-notes-internal.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,31 @@ 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.0.0-alpha.3

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

- [Opentrons changes since the latest stable release](https://github.com/Opentrons/opentrons/compare/[email protected])
- [Opentrons changes since the last internal release](https://github.com/Opentrons/opentrons/compare/[email protected]@2.0.0-alpha.3)
- [Flex changes](https://github.com/Opentrons/oe-core/compare/[email protected]@2.0.0-alpha.3)
- [Flex firmware changes](https://github.com/Opentrons/ot3-firmware/compare/[email protected]@v10)
- [OT2 changes](https://github.com/Opentrons/buildroot/compare/[email protected])

## Internal Release 2.0.0-alpha.2

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

<https://github.com/Opentrons/opentrons/compare/[email protected]@2.0.0-alpha.2>

## Internal Release 2.0.0-alpha.1

This internal release, pulled from the `edge` branch, contains features being developed for 8.0.0. It's for internal testing only. Usage may require a robot factory reset to restore robot stability.
This internal release, pulled from the `edge` branch, contains features being developed for 8.0.0. It's for internal testing only.

<https://github.com/Opentrons/opentrons/compare/[email protected]@2.0.0-alpha.1>

## Internal Release 2.0.0-alpha.0

This internal release, pulled from the `edge` branch, contains features being developed for 8.0.0. It's for internal testing only. Usage may require a robot factory reset to restore robot stability.
This internal release, pulled from the `edge` branch, contains features being developed for 8.0.0. It's for internal testing only.

<https://github.com/Opentrons/opentrons/compare/[email protected]@2.0.0-alpha.0>

Expand Down
14 changes: 11 additions & 3 deletions api/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,23 @@ log][]. For a list of currently known issues, please see the [Opentrons issue tr

---

## Opentrons Robot Software Changes in 7.4.0
## Opentrons Robot Software Changes in 7.5.0

Welcome to the v7.4.0 release of the Opentrons robot software!
Welcome to the v7.5.0 release of the Opentrons robot software!

This release adds support for the [Opentrons Flex HEPA/UV Module](https://opentrons.com/products/opentrons-flex-hepa-uv-module).
### Hardware Support

- [Opentrons Flex HEPA/UV Module](https://opentrons.com/products/opentrons-flex-hepa-uv-module)
- Latest Flex Gripper model (serial numbers beginning `GRPV13`)

### Bug Fixes

- Fixed certain string runtime parameter values being misinterpreted as an incorrect type.

### Known Issue

- The HEPA/UV Module's buttons may not respond properly after its safety shutoff is activated. This happens when the module is removed from the top of Flex while its lights are on. Power cycle the module to restore normal behavior. The module is safe to use even if you do not power cycle it.

---

## Opentrons Robot Software Changes in 7.3.1
Expand Down
1 change: 1 addition & 0 deletions api/src/opentrons/cli/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ async def _do_analyze(protocol_source: ProtocolSource) -> RunResult:
protocol_source=protocol_source,
parse_mode=ParseMode.NORMAL,
run_time_param_values=None,
run_time_param_files=None,
)
except Exception as error:
err_id = "analysis-setup-error"
Expand Down
8 changes: 7 additions & 1 deletion api/src/opentrons/hardware_control/ot3api.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ async def reset_tip_detectors(

@ExecutionManagerProvider.wait_for_running
async def _update_position_estimation(
self, axes: Optional[List[Axis]] = None
self, axes: Optional[Sequence[Axis]] = None
) -> None:
"""
Function to update motor estimation for a set of axes
Expand Down Expand Up @@ -1141,6 +1141,12 @@ async def gantry_position(
z=cur_pos[Axis.by_mount(realmount)],
)

async def update_axis_position_estimations(self, axes: Sequence[Axis]) -> None:
"""Update specified axes position estimators from their encoders."""
await self._update_position_estimation(axes)
await self._cache_current_position()
await self._cache_encoder_position()

async def move_to(
self,
mount: Union[top_types.Mount, OT3Mount],
Expand Down
10 changes: 2 additions & 8 deletions api/src/opentrons/hardware_control/protocols/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
"""Typing protocols describing a hardware controller."""
from typing_extensions import Protocol, Type

from opentrons.hardware_control.types import Axis

from .module_provider import ModuleProvider
from .hardware_manager import HardwareManager
from .chassis_accessory_manager import ChassisAccessoryManager
Expand All @@ -20,6 +18,7 @@
from .gripper_controller import GripperController
from .flex_calibratable import FlexCalibratable
from .flex_instrument_configurer import FlexInstrumentConfigurer
from .position_estimator import PositionEstimator

from .types import (
CalibrationType,
Expand Down Expand Up @@ -64,6 +63,7 @@ def cache_tip(self, mount: MountArgType, tip_length: float) -> None:


class FlexHardwareControlInterface(
PositionEstimator,
ModuleProvider,
ExecutionControllable,
LiquidHandler[CalibrationType, MountArgType, ConfigType],
Expand All @@ -87,12 +87,6 @@ class FlexHardwareControlInterface(
def get_robot_type(self) -> Type[FlexRobotType]:
return FlexRobotType

def motor_status_ok(self, axis: Axis) -> bool:
...

def encoder_status_ok(self, axis: Axis) -> bool:
...

def cache_tip(self, mount: MountArgType, tip_length: float) -> None:
...

Expand Down
43 changes: 43 additions & 0 deletions api/src/opentrons/hardware_control/protocols/position_estimator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
from typing import Protocol, Sequence

from ..types import Axis


class PositionEstimator(Protocol):
"""Position-control extensions for harwdare with encoders."""

async def update_axis_position_estimations(self, axes: Sequence[Axis]) -> None:
"""Update the specified axes' position estimators from their encoders.
This will allow these axes to make a non-home move even if they do not currently have
a position estimation (unless there is no tracked poition from the encoders, as would be
true immediately after boot).
Axis encoders have less precision than their position estimators. Calling this function will
cause absolute position drift. After this function is called, the axis should be homed before
it is relied upon for accurate motion.
This function updates only the requested axes. If other axes have bad position estimation,
moves that require those axes or attempts to get the position of those axes will still fail.
"""
...

def motor_status_ok(self, axis: Axis) -> bool:
"""Return whether an axis' position estimator is healthy.
The position estimator is healthy if the axis has
1) been homed
2) not suffered a loss-of-positioning (from a cancel or stall, for instance) since being homed
If this function returns false, getting the position of this axis or asking it to move will fail.
"""
...

def encoder_status_ok(self, axis: Axis) -> bool:
"""Return whether an axis' position encoder tracking is healthy.
The encoder status is healthy if the axis has been homed since booting up.
If this function returns false, updating the estimator from the encoder will fail.
"""
...
41 changes: 39 additions & 2 deletions api/src/opentrons/protocol_api/_parameter_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
ParameterChoice,
UserFacingTypes,
)
from opentrons.protocols.parameters.exceptions import ParameterDefinitionError
from opentrons.protocols.parameters.exceptions import (
ParameterDefinitionError,
ParameterValueError,
)
from opentrons.protocol_engine.types import (
RunTimeParameter,
PrimitiveRunTimeParamValuesType,
CSVRunTimeParamFilesType,
FileInfo,
)

from ._parameters import Parameters
Expand Down Expand Up @@ -202,13 +207,45 @@ def set_parameters(
f"Parameter {variable_name} is not defined as a parameter for this protocol."
)
if isinstance(parameter, csv_parameter_definition.CSVParameterDefinition):
pass
raise ParameterValueError(
f"A primitive param value was provided for the parameter '{variable_name}',"
f" but '{variable_name}' is a CSV parameter that can only accept file IDs."
)
else:
validated_value = validation.ensure_value_type(
override_value, parameter.parameter_type
)
parameter.value = validated_value

def initialize_csv_files(
self, run_time_param_file_overrides: CSVRunTimeParamFilesType
) -> None:
"""Initializes the files for CSV parameters.
:meta private:
This is intended for Opentrons internal use only and is not a guaranteed API.
"""
for variable_name, file_id in run_time_param_file_overrides.items():
try:
parameter = self._parameters[variable_name]
except KeyError:
raise ParameterDefinitionError(
f"Parameter {variable_name} is not defined as a parameter for this protocol."
)
if not isinstance(
parameter, csv_parameter_definition.CSVParameterDefinition
):
raise ParameterValueError(
f"File Id was provided for the parameter '{variable_name}',"
f" but '{variable_name}' is not a CSV parameter."
)

parameter.file_info = FileInfo(id=file_id, name="")
# TODO (spp, 2024-07-16): set the file name and assign the file as parameter.value.
# Most likely, we will be creating a temporary file copy of the original
# to pass onto the protocol context

def export_parameters_for_analysis(self) -> List[RunTimeParameter]:
"""Exports all parameters into a protocol engine models for reporting in analysis.
Expand Down
10 changes: 9 additions & 1 deletion api/src/opentrons/protocol_engine/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
CommandDefinedErrorData,
CommandPrivateResult,
)
from ..error_recovery_policy import ErrorRecoveryType
from ..error_recovery_policy import ErrorRecoveryPolicy, ErrorRecoveryType
from ..notes.notes import CommandNote
from ..types import (
LabwareOffsetCreate,
Expand Down Expand Up @@ -266,6 +266,13 @@ class SetPipetteMovementSpeedAction:
speed: Optional[float]


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

error_recovery_policy: ErrorRecoveryPolicy


Action = Union[
PlayAction,
PauseAction,
Expand All @@ -286,4 +293,5 @@ class SetPipetteMovementSpeedAction:
AddLiquidAction,
ResetTipsAction,
SetPipetteMovementSpeedAction,
SetErrorRecoveryPolicyAction,
]
3 changes: 3 additions & 0 deletions api/src/opentrons/protocol_engine/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from . import temperature_module
from . import thermocycler
from . import calibration
from . import unsafe

from .hash_command_params import hash_protocol_command_params
from .generate_command_schema import generate_command_schema
Expand Down Expand Up @@ -548,6 +549,8 @@
"thermocycler",
# calibration command bundle
"calibration",
# unsafe command bundle
"unsafe",
# configure pipette volume command bundle
"ConfigureForVolume",
"ConfigureForVolumeCreate",
Expand Down
16 changes: 16 additions & 0 deletions api/src/opentrons/protocol_engine/commands/command_unions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from . import thermocycler

from . import calibration
from . import unsafe

from .set_rail_lights import (
SetRailLights,
Expand Down Expand Up @@ -387,6 +388,9 @@
calibration.CalibratePipette,
calibration.CalibrateModule,
calibration.MoveToMaintenancePosition,
unsafe.UnsafeBlowOutInPlace,
unsafe.UnsafeDropTipInPlace,
unsafe.UpdatePositionEstimators,
],
Field(discriminator="commandType"),
]
Expand Down Expand Up @@ -456,6 +460,9 @@
calibration.CalibratePipetteParams,
calibration.CalibrateModuleParams,
calibration.MoveToMaintenancePositionParams,
unsafe.UnsafeBlowOutInPlaceParams,
unsafe.UnsafeDropTipInPlaceParams,
unsafe.UpdatePositionEstimatorsParams,
]

CommandType = Union[
Expand Down Expand Up @@ -523,6 +530,9 @@
calibration.CalibratePipetteCommandType,
calibration.CalibrateModuleCommandType,
calibration.MoveToMaintenancePositionCommandType,
unsafe.UnsafeBlowOutInPlaceCommandType,
unsafe.UnsafeDropTipInPlaceCommandType,
unsafe.UpdatePositionEstimatorsCommandType,
]

CommandCreate = Annotated[
Expand Down Expand Up @@ -591,6 +601,9 @@
calibration.CalibratePipetteCreate,
calibration.CalibrateModuleCreate,
calibration.MoveToMaintenancePositionCreate,
unsafe.UnsafeBlowOutInPlaceCreate,
unsafe.UnsafeDropTipInPlaceCreate,
unsafe.UpdatePositionEstimatorsCreate,
],
Field(discriminator="commandType"),
]
Expand Down Expand Up @@ -660,6 +673,9 @@
calibration.CalibratePipetteResult,
calibration.CalibrateModuleResult,
calibration.MoveToMaintenancePositionResult,
unsafe.UnsafeBlowOutInPlaceResult,
unsafe.UnsafeDropTipInPlaceResult,
unsafe.UpdatePositionEstimatorsResult,
]

# todo(mm, 2024-06-12): Ideally, command return types would have specific
Expand Down
Loading

0 comments on commit bcec2ec

Please sign in to comment.