From 89a55f35b8e6f77dcb804da2864f56deda330c17 Mon Sep 17 00:00:00 2001 From: ahiuchingau <20424172+ahiuchingau@users.noreply.github.com> Date: Fri, 10 May 2024 16:50:22 -0400 Subject: [PATCH] remove protocol-engine commands --- .../commands/absorbance_reader/__init__.py | 17 ----- .../commands/absorbance_reader/measure.py | 75 ------------------- 2 files changed, 92 deletions(-) delete mode 100644 api/src/opentrons/protocol_engine/commands/absorbance_reader/__init__.py delete mode 100644 api/src/opentrons/protocol_engine/commands/absorbance_reader/measure.py diff --git a/api/src/opentrons/protocol_engine/commands/absorbance_reader/__init__.py b/api/src/opentrons/protocol_engine/commands/absorbance_reader/__init__.py deleted file mode 100644 index b1bd90510d89..000000000000 --- a/api/src/opentrons/protocol_engine/commands/absorbance_reader/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -"""Command models for Absorbance Reader commands.""" - -from .measure import ( - AbsorbanceMeasureCommandType, - AbsorbanceMeasureParams, - AbsorbanceMeasureResult, - AbsorbanceMeasure, - AbsorbanceMeasureCreate, -) - -__all__ = [ - "AbsorbanceMeasureCommandType", - "AbsorbanceMeasureParams", - "AbsorbanceMeasureResult", - "AbsorbanceMeasure", - "AbsorbanceMeasureCreate", -] diff --git a/api/src/opentrons/protocol_engine/commands/absorbance_reader/measure.py b/api/src/opentrons/protocol_engine/commands/absorbance_reader/measure.py deleted file mode 100644 index a8d12d163d19..000000000000 --- a/api/src/opentrons/protocol_engine/commands/absorbance_reader/measure.py +++ /dev/null @@ -1,75 +0,0 @@ -"""Command models to execute a Thermocycler profile.""" -from __future__ import annotations -from typing import List, Optional, TYPE_CHECKING -from typing_extensions import Literal, Type - -from pydantic import BaseModel, Field - -from opentrons.hardware_control.modules.types import ThermocyclerStep - -from ..command import AbstractCommandImpl, BaseCommand, BaseCommandCreate - -if TYPE_CHECKING: - from opentrons.protocol_engine.state import StateView - from opentrons.protocol_engine.execution import EquipmentHandler - - -AbsorbanceMeasureCommandType = Literal["absorbanceReader/measure"] - - -class AbsorbanceMeasureParams(BaseModel): - """Input parameters for a single absorbance reading.""" - - moduleId: str = Field(..., description="Unique ID of the Thermocycler.") - sampleWavelength: float = Field(..., description="Sample wavelength in nm.") - - -class AbsorbanceMeasureResult(BaseModel): - """Result data from running an aborbance reading.""" - - data: List[float] = Field(..., description="Absorbance data points.") - - -class AbsorbanceMeasureImpl( - AbstractCommandImpl[AbsorbanceMeasureParams, AbsorbanceMeasureResult] -): - """Execution implementation of a Thermocycler's run profile command.""" - - def __init__( - self, - state_view: StateView, - equipment: EquipmentHandler, - **unused_dependencies: object, - ) -> None: - self._state_view = state_view - self._equipment = equipment - - async def execute(self, params: AbsorbanceMeasureParams) -> AbsorbanceMeasureResult: - """Initiate a single absorbance measurement.""" - abs_reader_substate = self._state_view.modules.get_absorbance_reader_substate( - module_id=params.moduleId - ) - # Allow propagation of ModuleNotAttachedError. - abs_reader = self._equipment.get_module_hardware_api( - abs_reader_substate.module_id - ) - return AbsorbanceMeasureResult(data=[]) - - -class AbsorbanceMeasure(BaseCommand[AbsorbanceMeasureParams, AbsorbanceMeasureResult]): - """A command to execute an Absorbance Reader measurement.""" - - commandType: AbsorbanceMeasureCommandType = "absorbanceReader/measure" - params: AbsorbanceMeasureParams - result: Optional[AbsorbanceMeasureResult] - - _ImplementationCls: Type[AbsorbanceMeasureImpl] = AbsorbanceMeasureImpl - - -class AbsorbanceMeasureCreate(BaseCommandCreate[AbsorbanceMeasureParams]): - """A request to execute an Absorbance Reader measurement.""" - - commandType: AbsorbanceMeasureCommandType = "absorbanceReader/measure" - params: AbsorbanceMeasureParams - - _CommandCls: Type[AbsorbanceMeasure] = AbsorbanceMeasure