-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat(api): publish pause and delay commands in python and JSON #3310
Conversation
This adds an optional message parameter to the delay function in the python apiv2. The message is published to the run log appended to the standard timing message. The json executor for apiv1 and apiv2 is capable of receiving messages for both delays and pauses. This will allow PD user's input Pause step messages to be presented in the App's run log regardless of the duration (including indefinite holds) of a pause. Closes #3308
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.
Code LGTM
Codecov Report
@@ Coverage Diff @@
## edge #3310 +/- ##
==========================================
- Coverage 53.63% 53.01% -0.63%
==========================================
Files 719 737 +18
Lines 21017 22088 +1071
==========================================
+ Hits 11272 11709 +437
- Misses 9745 10379 +634
Continue to review full report at Codecov.
|
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.
Tested on 🌆 . @IanLondon said to wait to merge this until his PR is in
Please don't merge until #3312 thanks! |
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.
api v1 timed delays make a message string but doesn't use it as a message
robot.pause(msg=message) | ||
else: | ||
text = f'Delaying for {datetime.timedelta(seconds=wait)}' | ||
if message: | ||
text = f"{text}. {message}" |
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.
this text
var doesn't go anywhere, so APIv1 runs don't give a message for timed delays
@@ -169,14 +169,15 @@ def dispatch_json(context: ProtocolContext, # noqa(C901) | |||
pipette_name = protocol_pipette_data.get('model') | |||
|
|||
if command_type == 'delay': | |||
wait = params['wait'] | |||
wait = params.get('wait') |
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.
wait
is required in schema v1/2/3, so we can do params['wait']
no need to get
. Message is optional so get
is right there
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.
⏲️
This adds an optional message parameter to the delay function in the python apiv2. The message is
published to the run log appended to the standard timing message eg "Delay for 10m 2s".
In addition, the JSON executor for apiv1 and apiv2 is now capable of receiving messages for both delays and pauses. This will allow PD user's input within Pause step messages to be presented in the App's run log regardless of the duration (including indefinite holds) of a pause.
Closes #3308
##Changelog
msg
param for python APIv2delay
functionReview Requests