Skip to content
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, robot-server): Allow loadLiquid commands and liquids support in protocol engine and analysis #11310

Merged
merged 101 commits into from
Aug 23, 2022

Conversation

TamarZanzouri
Copy link
Contributor

@TamarZanzouri TamarZanzouri commented Aug 9, 2022

Overview

closes Jira ticket RLIQ-8.
this PR gives protocol engine the ability to consume and analyze loadLiquid and store liquids in the engine state.

Changelog

  • Add LoadLiquid command to protocol engine
  • Added AddLiquidAction to protocol engine
  • Added Liquids state to hold liquids.
  • Added Liquids to Analysis and AnalysisSummery
  • Added Liquids to StateSummery and to Run

Review requests

  1. Did I miss anything?
  2. Was not tested on hardware yet
  3. Are the test changes sufficient?

Risk assessment

Medium. Added a new command, should not effect if not being called. added Liquids to StateSummery and Run data models. need to make sure old logic is not effected.

@TamarZanzouri TamarZanzouri added the robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). label Aug 9, 2022
@codecov
Copy link

codecov bot commented Aug 9, 2022

Codecov Report

Merging #11310 (06f6dd3) into edge (2c24801) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #11310   +/-   ##
=======================================
  Coverage   74.53%   74.53%           
=======================================
  Files        2033     2033           
  Lines       56588    56588           
  Branches     5437     5437           
=======================================
  Hits        42180    42180           
  Misses      13180    13180           
  Partials     1228     1228           
Flag Coverage Δ
app 74.70% <ø> (ø)
components 53.05% <ø> (ø)
labware-library 49.74% <ø> (ø)
notify-server 89.17% <ø> (ø)
protocol-designer 45.81% <ø> (ø)
shared-data 86.11% <ø> (ø)
step-generation 88.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/src/opentrons/protocol_engine/__init__.py 100.00% <ø> (ø)
.../src/opentrons/protocol_engine/actions/__init__.py 100.00% <ø> (ø)
...i/src/opentrons/protocol_engine/errors/__init__.py 100.00% <ø> (ø)
...i/src/opentrons/protocol_engine/protocol_engine.py 100.00% <ø> (ø)
api/src/opentrons/protocol_engine/types.py 97.77% <ø> (ø)
...t-server/robot_server/protocols/analysis_models.py 100.00% <ø> (ø)
...ot-server/robot_server/protocols/analysis_store.py 100.00% <ø> (ø)
...server/robot_server/protocols/protocol_analyzer.py 100.00% <ø> (ø)
...i/src/opentrons/protocol_engine/actions/actions.py 100.00% <100.00%> (ø)
...src/opentrons/protocol_engine/commands/__init__.py 100.00% <100.00%> (ø)
... and 20 more

assert result == LoadLiquidResult()


async def test_load_liquid_liquid_not_found(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these tests redundant now that the logic lives in the state?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe delete these test

"""Get all protocol liquids."""
return list(self._state.liquids_by_id.values())

def validate_has_liquid(self, liquid_id: str) -> str:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment ^

Copy link
Contributor

@Laura-Danielle Laura-Danielle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks great :) had a few questions about some things.

api/src/opentrons/protocol_engine/commands/load_liquid.py Outdated Show resolved Hide resolved
api/src/opentrons/protocol_engine/state/labware.py Outdated Show resolved Hide resolved
api/src/opentrons/protocol_engine/state/liquids.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few final notes. Will approve when I've been able to smoke test against persisted protocols / analyses to make sure we don't have any data migration issues

api/src/opentrons/protocol_engine/state/labware.py Outdated Show resolved Hide resolved
robot-server/robot_server/runs/run_models.py Outdated Show resolved Hide resolved
@TamarZanzouri
Copy link
Contributor Author

Tested on a robot with json v5 and v6 protocols

Copy link
Contributor

@mcous mcous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke tested with the dev server, did not encounter any data migration issues with persisted protocol / analysis / run / commands data from prior to this PR.

Nice work!

@TamarZanzouri TamarZanzouri merged commit 1c6d0b3 into edge Aug 23, 2022
@SyntaxColoring SyntaxColoring deleted the feature/liquid-handling-pe branch August 23, 2022 20:25
sfoster1 pushed a commit that referenced this pull request Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants