Skip to content

Commit 8723c07

Browse files
committed
reverted create_run_orchestartor and lint fixing
1 parent 7a12214 commit 8723c07

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

api/src/opentrons/execute.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,13 +631,28 @@ async def run(protocol_source: ProtocolSource) -> None:
631631
load_fixed_trash=should_load_fixed_trash(protocol_source.config),
632632
)
633633

634-
orchestrator = RunOrchestrator.build_orchestrator(
634+
protocol_runner = create_protocol_runner(
635+
protocol_config=protocol_source.config,
636+
protocol_engine=protocol_engine,
637+
hardware_api=hardware_api_wrapped,
638+
)
639+
640+
orchestrator = RunOrchestrator(
635641
hardware_api=hardware_api_wrapped,
636642
protocol_engine=protocol_engine,
637-
protocol_config=protocol_source.config,
643+
json_or_python_protocol_runner=protocol_runner,
644+
fixit_runner=LiveRunner(
645+
protocol_engine=protocol_engine, hardware_api=hardware_api_wrapped
646+
),
647+
setup_runner=LiveRunner(
648+
protocol_engine=protocol_engine, hardware_api=hardware_api_wrapped
649+
),
650+
protocol_live_runner=LiveRunner(
651+
protocol_engine=protocol_engine, hardware_api=hardware_api_wrapped
652+
),
638653
)
639654

640-
unsubscribe = orchestrator.get_protocol_runner().broker.subscribe(
655+
unsubscribe = protocol_runner.broker.subscribe(
641656
"command", lambda event: emit_runlog(event) if emit_runlog else None
642657
)
643658
try:

api/src/opentrons/protocol_engine/execution/queue_worker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ async def join(self) -> None:
7070
async def _run_commands(self) -> None:
7171
async for command_id in self._command_generator():
7272
await self._command_executor.execute(command_id=command_id)
73-
# Yield to the event loop in case we're executing a long sequence of commands
74-
# that never yields internally. For example, a long sequence of comment commands.
73+
# Yield to the event loop in case we're executing a long sequence of commands
74+
# that never yields internally. For example, a long sequence of comment commands.
7575
await asyncio.sleep(0)

api/tests/opentrons/protocol_runner/test_run_orchestrator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from pytest_lazyfixture import lazy_fixture # type: ignore[import-untyped]
88
from decoy import Decoy
9-
from typing import Union, AsyncGenerator
9+
from typing import Union, Generator
1010

1111
from opentrons.protocol_engine.errors import RunStoppedError
1212
from opentrons.protocol_engine.state import StateStore
@@ -509,7 +509,7 @@ async def test_command_generator(
509509
) -> None:
510510
"""Should get the next command to execute."""
511511

512-
def get_next_to_execute() -> AsyncGenerator[str, None]:
512+
def get_next_to_execute() -> Generator[str, None, None]:
513513
yield "command-id-1"
514514
yield "command-id-2"
515515
raise RunStoppedError()

0 commit comments

Comments
 (0)