-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
528 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"""Map command request and model types to other values.""" | ||
|
||
|
||
class CommandMapper: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
api/src/opentrons/protocol_engine/execution/command_executor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
"""Command side-effect execution logic container.""" | ||
from __future__ import annotations | ||
|
||
from opentrons.hardware_control.api import API as HardwareAPI | ||
|
||
from ..resources import ResourceProviders | ||
from ..state import StateStore | ||
from ..commands import Command, CommandRequest | ||
from .equipment import EquipmentHandler | ||
from .movement import MovementHandler | ||
from .pipetting import PipettingHandler | ||
|
||
|
||
class CommandExecutor: | ||
"""CommandExecutor container class. | ||
CommandExecutor manages various child handlers that define procedures to | ||
execute the side-effects of commands. | ||
""" | ||
|
||
def __init__( | ||
self, | ||
hardware: HardwareAPI, | ||
state_store: StateStore, | ||
resources: ResourceProviders, | ||
) -> None: | ||
"""Initialize the CommandExecutor with access to its dependencies.""" | ||
self._hardware = hardware | ||
self._state_store = state_store | ||
self._resources = resources | ||
|
||
def create_command(self, request: CommandRequest) -> Command: | ||
raise NotImplementedError("CommandExecutor not implemented") | ||
|
||
def to_running(self, command: Command) -> Command: | ||
raise NotImplementedError("CommandExecutor not implemented") | ||
|
||
async def execute(self, command: Command) -> Command: | ||
raise NotImplementedError("CommandExecutor not implemented") | ||
|
||
# async def execute(self, command: Command) -> CommandResult: | ||
# state = self._state_store.state_view | ||
# hardware = self._hardware | ||
# resources = self._resources | ||
|
||
# equipment = EquipmentHandler( | ||
# state=state, | ||
# hardware=hardware, | ||
# resources=resources, | ||
# ) | ||
|
||
# movement = MovementHandler(state=state, hardware=hardware) | ||
|
||
# pipetting = PipettingHandler( | ||
# state=state, | ||
# hardware=hardware, | ||
# movement_handler=movement, | ||
# ) | ||
|
||
# command_impl = command.get_impl( | ||
# equipment=equipment, | ||
# movement=movement, | ||
# pipetting=pipetting, | ||
# ) | ||
|
||
# @property | ||
# def equipment(self) -> EquipmentHandler: | ||
# """Access equipment handling procedures.""" | ||
# return self._equipment | ||
|
||
# @property | ||
# def movement(self) -> MovementHandler: | ||
# """Access movement handling procedures.""" | ||
# return self._movement | ||
|
||
# @property | ||
# def pipetting(self) -> PipettingHandler: | ||
# """Access pipetting handling procedures.""" | ||
# return self._pipetting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"""Fixtures for protocol engine command tests.""" | ||
import pytest | ||
from decoy import Decoy | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.