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

refactor(api): better names for liquid probe commands #15578

Merged
merged 5 commits into from
Jul 8, 2024

Conversation

aaron-kulkarni
Copy link
Contributor

@aaron-kulkarni aaron-kulkarni commented Jul 3, 2024

Overview

Edit detect_liquid_presence, require_liquid_presence, and measure_liquid_height as per the standup today.

Change instrument_context tests to check for the right error(LiquidNotFoundError)

Split find_liquid_level into two functions: liquid_probe_with_recovery and liquid_probe_without_recovery

Test Plan

Added unit tests for liquid_probe_with_recovery and liquid_probe_without recovery to test_instrument_core.py
Added unit tests for detect_liquid_presence, require_liquid_presence, and measure_liquid_height to test_instrument_context.py

After the PR is merged, these API calls will be tested on the robot.

Changelog

Review requests

Accidentally merged #15555 too soon, this is a continuation of that PR.

Risk assessment

Low: Since all the work was done in newly created functions, the risk that it breaks existing code is minimal.
However, the new API calls still do need to be tested on a robot before they can be used in other parts of the system.

Edit detect_liquid_presence, require_liquid_presence, and measure_liquid_height as per the standup
today.
@aaron-kulkarni aaron-kulkarni requested a review from a team as a code owner July 3, 2024 19:19
Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks for the quick follow-up. A few adjustments:

api/src/opentrons/protocol_api/instrument_context.py Outdated Show resolved Hide resolved
api/src/opentrons/protocol_api/instrument_context.py Outdated Show resolved Hide resolved
api/src/opentrons/protocol_api/instrument_context.py Outdated Show resolved Hide resolved
api/src/opentrons/protocol_api/instrument_context.py Outdated Show resolved Hide resolved
api/src/opentrons/protocol_api/core/engine/instrument.py Outdated Show resolved Hide resolved
api/src/opentrons/protocol_api/instrument_context.py Outdated Show resolved Hide resolved
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

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

Before we merge, let's

  • Change the subject line of the PR to be an indication of what the changes do, rather than what the changes are (for instance, refactor(api): better names for liquid probe commands, or refactor(api): handle errors in liquid probe commands)
  • Since the subject line is too small to have enough information, use the description to go into more depth, even if that depth is just a bullet list about changing names and handling errors

@aaron-kulkarni aaron-kulkarni changed the title refactor(api): edit 3 instr context methods for liquid probe refactor(api): better names for liquid probe commands Jul 5, 2024
Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

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

  • Here are a couple of test fixups.

  • Let's try to fill in the "test plan" and "risk assessment" sections of the PR description.

    I think I overheard you and @ryanthecoder talk about writing some Python protocols to play around with it. That sounds like a good idea, and you can describe that as the test plan. Just make it clear whether you're going to do that before or after merging this.

Other than that, looks great.

P.S. Here is the bug that I'm predicting will be exposed by this, which I alluded to in the last PR. EXEC-598. (It's my fault, not yours. 🙂)

Copy link
Contributor

@SyntaxColoring SyntaxColoring left a comment

Choose a reason for hiding this comment

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

This looks good to me to merge once the print() statement is removed.

One note about test_liquid_probe_without_recovery() for future reference, but I think we can move on for now.

@aaron-kulkarni aaron-kulkarni merged commit bd4f9a2 into edge Jul 8, 2024
21 checks passed
@aaron-kulkarni aaron-kulkarni deleted the instr-context-changes branch July 8, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants