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

fix(api): Tip pickup call validation near wastechute #14415

Merged
merged 14 commits into from
Feb 5, 2024

Conversation

CaseyBatten
Copy link
Contributor

Special Note: This is a replacement for #14371 due to a potentially problematic keyerror bug that would occur on any height checking that resulted in a fixture being the highest item in the adjacent slots. This seeks to add back the capability of #14371 as well as fix that bug.

Overview

This seeks to fix issues related to RSS-375 and RSS-422.

Of note, this will only fix issues during runtime. Currently when in partial tip configuration the engine will attempt to check the height of object adjacent to the slot that an action (such as pickup tip) is occurring in. However, only the heigh of labware and module is checked, the system does not check for the height of fixtures loaded into the deck configuration.

To solve this, a method has been added to allow for searching of Cutout fixtures by deck slot name, and then the height of a returned fixture is then checked alongside the labware and module heights. If, for example a waste chute is loaded in D3 and a partial tip pickup is attempted in D2, the engine will raise an error.

Test Plan

Ensure that a protocol with a waste chute loaded in D3 with a 96 channel in partial tip configuration set to pick up tips from column A12 of a tiprack in D2 using column A1 of the instrument raises an error during operation before a collision would occur.
The following protocol ought to produce the expected results:

from opentrons.protocol_api import COLUMN, ALL

requirements = {
	"robotType": "Flex",
	"apiLevel": "2.16"
}

def run(protocol_context):
	tip_rack1 = protocol_context.load_labware("opentrons_flex_96_tiprack_50ul", "D2")
	instrument = protocol_context.load_instrument('flex_96channel_1000', mount="left", tip_racks=[tip_rack1])

	waste_chute = protocol_context.load_waste_chute()

	instrument.configure_nozzle_layout(style=COLUMN, start="A1")

	instrument.pick_up_tip(tip_rack1)
	instrument.drop_tip(waste_chute)

Risk assessment

While the robot will prevent a collision during runtime, a protocol where a crash would occur would still pass analysis. This is in part due to the fact that we do not load a true deck configuration for analysis, so when checking the set of loaded fixtures we see that there are "None", even if that is untrue. This is yet another item that would become simpler with multipass analysis.

@CaseyBatten CaseyBatten requested a review from a team as a code owner February 2, 2024 14:51
@CaseyBatten CaseyBatten requested a review from a team February 2, 2024 15:34
@CaseyBatten CaseyBatten changed the title Tip pickup call validation near wastechute fix(api): Tip pickup call validation near wastechute Feb 2, 2024
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8485b67) 68.21% compared to head (8c66714) 68.21%.
Report is 14 commits behind head on edge.

❗ Current head 8c66714 differs from pull request most recent head c49401f. Consider uploading reports for the commit c49401f to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             edge   #14415   +/-   ##
=======================================
  Coverage   68.21%   68.21%           
=======================================
  Files        2520     2520           
  Lines       71892    71892           
  Branches     9188     9188           
=======================================
  Hits        49042    49042           
  Misses      20677    20677           
  Partials     2173     2173           
Flag Coverage Δ
g-code-testing 96.48% <ø> (ø)

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

Files Coverage Δ
...pi/src/opentrons/protocol_engine/state/geometry.py 100.00% <ø> (ø)

@CaseyBatten
Copy link
Contributor Author

Tested the protocol in the Testing Plan on Flex, resulted correctly with the following expected error:
Error 2004: PartialTipMovementNotAllowedError

Moving to Opentrons Flex 96 Tip Rack 50 µL in slot D2 with pipette column A1 nozzle configuration will result in collision with items in deck slot D3.

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 merge if it's been tested.

I have a few code-level comments, plus one bigger comment about how we're approaching this validation, architecturally.

@CaseyBatten CaseyBatten merged commit af9da37 into edge Feb 5, 2024
20 checks passed
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.

Sorry for getting this in late. Added comments

if deck_config:
slot_cutout_id = DECK_SLOT_TO_CUTOUT_MAP[slot_name]
slot_cutout_fixture = None
# This will only ever be one under current assumptions
Copy link
Member

Choose a reason for hiding this comment

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

Not sure what this means. Can you clarify?

break
if slot_cutout_fixture is None:
raise CutoutDoesNotExistError(
f"No Cutout was found in the Deck that matched provided slot {slot_name}."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
f"No Cutout was found in the Deck that matched provided slot {slot_name}."
f"No Cutout matching the provided slot ({slot_name}) was found in the deck configuration."

@CaseyBatten CaseyBatten deleted the tip_pickup_call_validation_near_wastechute branch February 6, 2024 22:27
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