feat(protocol-designer): add python field to commands and timeline #17383
+84
−0
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.
Overview
This starts the plumbing for Python generation from Protocol Designer. AUTH-1385
We're adding a field for Python code to each command (
CommandsAndWarnings
) and to each entry of the timeline (CommandsAndRobotState
). And in the reducer, we concatenate the Python commands together, analogously to how we concatenate the JSON commands together.Test Plan and Hands on Testing
I added unit tests to show that the Python code concatenation works, and that the Python code gets copied from the CommandCreators to the Timeline. The tests also demonstrate that the changes do NOT affect the behavior of existing commands that don't generate Python.
I've also done hands-on testing in a private experimental branch that has a more complete implementation of Python generation.
Review requests
My first time making a functional change to PD, let me know if I'm overlooking anything.
Risk assessment
Low. Should not cause any observable change to PD's behavior.