-
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
feat(api): Implement define_liquid
and load_liquid
in PAPI
#11920
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #11920 +/- ##
=======================================
Coverage 74.00% 74.00%
=======================================
Files 2193 2193
Lines 60665 60665
Branches 6418 6418
=======================================
Hits 44894 44894
Misses 14236 14236
Partials 1535 1535
Flags with carried forward coverage won't be shown. Click here to find out more.
|
8d814dd
to
1115693
Compare
Tested on OT-2 with core ff on. tested json/python protocols. works as expected. |
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.
Couple comments on docstrings including 1 typo.
api/src/opentrons/protocol_api/core/legacy/legacy_protocol_core.py
Outdated
Show resolved
Hide resolved
def add_liquid( | ||
self, | ||
name: str, | ||
color: Optional[str] = None, | ||
description: str = "", | ||
id: Optional[str] = None, | ||
) -> Liquid: | ||
"""Add a liquid to the state for subsequent liquid loads.""" | ||
self._action_dispatcher.dispatch(AddLiquidAction(liquid=liquid)) | ||
if id is None: | ||
id = self._model_utils.generate_id() | ||
self._action_dispatcher.dispatch( | ||
AddLiquidAction(id=id, name=name, color=color, description=description) | ||
) | ||
return Liquid( | ||
id=id, | ||
displayName=name, | ||
description=description, | ||
displayColor=HexColor(__root__=color) if color else None, | ||
) |
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.
Could you explain this change?
It looks like we're constructing a Liquid
in the exact same way here, in LiquidStore
, and in ProtocolRunner
. Why shouldn't AddLiquidAction
continue to take an already-constructed Liquid
?
api/tests/opentrons/protocol_api/core/engine/test_protocol_core.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Mike Cousins <[email protected]>
Co-authored-by: Mike Cousins <[email protected]>
Co-authored-by: Ed Cormany <[email protected]>
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.
Just a couple docstring typos.
Co-authored-by: Ed Cormany <[email protected]>
Co-authored-by: Ed Cormany <[email protected]>
define_liquid
and load_liquid
in PAPI
Tested on dev server with core ff on, python protocols and json protocols. works as expected! |
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.
LGTM
Overview
closes https://opentrons.atlassian.net/browse/RLIQ-7.
Add a
define_liquid
andload_liquid
in PAPI.Test Plan
Changelog
define_liquid
toprotocol_context
and to protocol core's implementation.load_liquid
towell_context
and to well core's implementation.load_liquid
tosync_client
.add_liquid
tosync_client
.Review requests
Risk assessment
Low. added a new end points in the PAPI to
define_liquid
andload_liquid
.