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): Forbid Heater-Shakers in slot 9, just south of the trash #11019

Merged
merged 3 commits into from
Jul 6, 2022

Conversation

SyntaxColoring
Copy link
Contributor

Overview

This PR adds a check to Python Protocol API v2's .load_module() method to prevent you from loading a Heater-Shaker into slot 9, because it would conflict with the fixed trash in "slot" 12.

metadata = {"apiLevel": "2.12"}

def run(protocol):
    hs = protocol.load_module('heaterShakerModuleV1', 9)
    # DeckConflictError:
    # opentrons_1_trash_1100ml_fixed in slot 12 prevents heaterShakerModuleV1 from using slot 9.

Closes #10912.

Review requests

  • Please scrutinize my refactor of _get_adjacent_locations() and friends to make sure I'm correctly preserving their existing behavior.
  • Is my understanding of the underlying conflict complete and correct?

    A Heater-Shaker can't safely be placed just south of the fixed trash, because the fixed trash blocks access to the screw that locks the Heater-Shaker onto the deck.

  • Do we want a ticket or # TODO comment somewhere for mirroring this logic in PAPIv3 or Protocol Engine?

Risk assessment

Low.

This change involved refactoring some unrelated deck conflict-checking code, so there is some risk of causing load_module() or load_labware() to either wrongly fail to report a conflict or wrongly report a nonexistent conflict. But this module seems covered well by unit and integration tests.

@SyntaxColoring SyntaxColoring requested a review from a team as a code owner July 6, 2022 17:41
@SyntaxColoring SyntaxColoring added api Affects the `api` project papi-v2 Python API V2 robot-svcs Falls under the purview of the Robot Services squad (formerly CPX, Core Platform Experience). heater-shaker heater shaker software support labels Jul 6, 2022
Comment on lines +230 to +232
# `item` is inconsistently provided to us as an AbstractLabware or Labware.
# See TODO comments in opentrons.protocols.geometry.deck,
# the module that calls into this module.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mcous I think you looked into this when you wrote this module originally. Is this a fair summary?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes it is. In practice, it will be a Labware when running a Python protocol, and AbstractLabware when running a JSON protocol

@codecov
Copy link

codecov bot commented Jul 6, 2022

Codecov Report

Merging #11019 (75c8ded) into edge (2da96a2) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #11019   +/-   ##
=======================================
  Coverage   73.78%   73.78%           
=======================================
  Files        2076     2076           
  Lines       57328    57328           
  Branches     5727     5727           
=======================================
  Hits        42300    42300           
  Misses      13789    13789           
  Partials     1239     1239           
Flag Coverage Δ
notify-server 89.17% <ø> (ø)

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

Impacted Files Coverage Δ
robot-server/robot_server/runs/run_store.py 100.00% <100.00%> (ø)

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.

Looks great!

Comment on lines +230 to +232
# `item` is inconsistently provided to us as an AbstractLabware or Labware.
# See TODO comments in opentrons.protocols.geometry.deck,
# the module that calls into this module.
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes it is. In practice, it will be a Labware when running a Python protocol, and AbstractLabware when running a JSON protocol

Copy link
Member

@sanni-t sanni-t left a comment

Choose a reason for hiding this comment

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

Nice!

@SyntaxColoring SyntaxColoring merged commit cb769cc into edge Jul 6, 2022
@SyntaxColoring SyntaxColoring deleted the forbid_hs_in_slot_9 branch July 6, 2022 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the `api` project heater-shaker heater shaker software support papi-v2 Python API V2 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.

feat: restrict Heater-Shaker from slot 9 in Python API
3 participants