-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(api, robot-server): Refactor ProtocolRunner per protocol type #12343
Merged
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
2410782
WIP: created an abstract interface for ProtocolRunner. started JsonRu…
TamarZanzouri 290e860
WIP create_protocol_runner
TamarZanzouri 842a99e
test json_runner and finished logic for json_runner
TamarZanzouri f5b5325
WIP python and legacy runner
TamarZanzouri 7de1dae
python and legacy runner implementation
TamarZanzouri 8f30fa7
create_simulating_runner.py
TamarZanzouri c73922c
fixed robot server dependencies.py
TamarZanzouri 33c260a
MaintenanceRunner
TamarZanzouri b727804
wip robot-server
TamarZanzouri 5ecd3cb
changed create_simulating_runner to monkeypatch
TamarZanzouri 037f322
removed set_run_started_at and fixed test failing on started_at
TamarZanzouri d54c1ec
rollback depends for protocol_analyzer.py and moved runner creation i…
TamarZanzouri af5aaac
reorganize prtocol_runner tests and text fixes
TamarZanzouri 3a870b0
removed task_queue from maintenance runner
TamarZanzouri 4009a37
Merge branch 'edge' into RSS-200-refactor-protocol-runner
TamarZanzouri 50978e3
linting
TamarZanzouri 20d3c3f
fixed failing test in actions router
TamarZanzouri 08524fd
fixed maintenance test with task runner
TamarZanzouri da0fdba
Update api/src/opentrons/protocol_runner/protocol_runner.py
TamarZanzouri b38aaf7
pr feedback
TamarZanzouri 14e2fa0
changed ProtocolRunResult to RunnerRunResult
TamarZanzouri 5aa7899
added linting ignore
TamarZanzouri f36be33
fixed g-code testing
TamarZanzouri a81df1d
g-code testing fix
TamarZanzouri b647315
linting
TamarZanzouri e802d65
linting
TamarZanzouri 923e00c
added pe.play for run live commands
TamarZanzouri e1e9ddd
added tavern test for posting protocol commands
TamarZanzouri 88cae89
addressed PR comments, fixed live runner bug, updated tests
sanni-t 742e292
updated tests, fixed linter errors
sanni-t 93be36f
Merge branch 'edge' into RSS-200-refactor-protocol-runner
sanni-t 56a1b2f
correct docstring
sanni-t b272e10
Apply suggestions from code review
sanni-t 433ca47
fix runner smoke tests and linter errors, some renaming from PR review
sanni-t b6e7385
update runner typing & type naming, renamed set_task_queue_wait() to …
sanni-t 5789c41
address all remaining review comments
sanni-t File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
changed ProtocolRunResult to RunnerRunResult
- Loading branch information
commit 14e2fa0fef3f248c0a5422721485ec2a3ffa8d4f
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
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 |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
) | ||
|
||
|
||
class ProtocolRunResult(NamedTuple): | ||
class RunnerRunResult(NamedTuple): | ||
"""Result data from a run, pulled from the ProtocolEngine.""" | ||
|
||
commands: List[Command] | ||
|
@@ -81,7 +81,7 @@ async def stop(self) -> None: | |
async def run( | ||
self, | ||
protocol_source: Optional[ProtocolSource] = None, | ||
) -> ProtocolRunResult: | ||
) -> RunnerRunResult: | ||
"""Run a given protocol to completion.""" | ||
|
||
|
||
|
@@ -166,7 +166,7 @@ async def stop(self) -> None: | |
async def run( | ||
self, | ||
protocol_source: Optional[ProtocolSource] = None, | ||
) -> ProtocolRunResult: | ||
) -> RunnerRunResult: | ||
# TODO(mc, 2022-01-11): move load to runner creation, remove from `run` | ||
# currently `protocol_source` arg is only used by tests | ||
if protocol_source: | ||
|
@@ -179,7 +179,7 @@ async def run( | |
|
||
run_data = self._protocol_engine.state_view.get_summary() | ||
commands = self._protocol_engine.state_view.commands.get_all() | ||
return ProtocolRunResult(commands=commands, state_summary=run_data) | ||
return RunnerRunResult(commands=commands, state_summary=run_data) | ||
|
||
|
||
class JsonRunner(AbstractRunner): | ||
|
@@ -268,7 +268,7 @@ async def stop(self) -> None: | |
async def run( | ||
self, | ||
protocol_source: Optional[ProtocolSource] = None, | ||
) -> ProtocolRunResult: | ||
) -> RunnerRunResult: | ||
# TODO(mc, 2022-01-11): move load to runner creation, remove from `run` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can totally do this for this pr |
||
# currently `protocol_source` arg is only used by tests | ||
if protocol_source: | ||
|
@@ -281,7 +281,7 @@ async def run( | |
|
||
run_data = self._protocol_engine.state_view.get_summary() | ||
commands = self._protocol_engine.state_view.commands.get_all() | ||
return ProtocolRunResult(commands=commands, state_summary=run_data) | ||
return RunnerRunResult(commands=commands, state_summary=run_data) | ||
|
||
|
||
class LiveRunner(AbstractRunner): | ||
|
@@ -324,15 +324,12 @@ async def stop(self) -> None: | |
async def run( | ||
self, | ||
protocol_source: Optional[ProtocolSource] = None, | ||
SyntaxColoring marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) -> ProtocolRunResult: | ||
if protocol_source: | ||
self.load(protocol_source) | ||
|
||
) -> RunnerRunResult: | ||
await self._hardware_api.home() | ||
|
||
run_data = self._protocol_engine.state_view.get_summary() | ||
commands = self._protocol_engine.state_view.commands.get_all() | ||
return ProtocolRunResult(commands=commands, state_summary=run_data) | ||
return RunnerRunResult(commands=commands, state_summary=run_data) | ||
|
||
|
||
def create_protocol_runner( | ||
|
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have a better name?
This comment was marked as outdated.
Sorry, something went wrong.