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): add tip tracking for partial tip configuration #14104

Merged
merged 8 commits into from
Dec 6, 2023

Conversation

sanni-t
Copy link
Member

@sanni-t sanni-t commented Dec 6, 2023

Closes RSS-299

Overview

Adds automatic tip selection for pipettes in partial tip configuration. Also updates signature of configure_nozzle_layout to include list of tip racks to use during the configuration.

Test Plan

Sample protocol for testing.

  • should raise errors where indicated
  • once erroring lines are removed/fixed, it should analyze successfully and run on the robot correctly
from opentrons.protocol_api import COLUMN, ALL


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

def run(protocol_context):
	trash_labware = protocol_context.load_labware("opentrons_1_trash_3200ml_fixed", "A3")

	tip_rack1 = protocol_context.load_labware("opentrons_flex_96_tiprack_50ul", "C3")
	tip_rack2 = protocol_context.load_labware("opentrons_flex_96_tiprack_200ul", "B3")
	tip_rack3 = protocol_context.load_labware("opentrons_flex_96_tiprack_200ul", "D3")


	instrument = protocol_context.load_instrument('flex_96channel_1000', mount="left", tip_racks=[tip_rack3, tip_rack2, tip_rack1])
	instrument.trash_container = trash_labware

	# Should pick all tips up from tiprack3
	instrument.pick_up_tip()
	instrument.drop_tip()

	instrument.configure_nozzle_layout(style=COLUMN, start="A12", tip_racks=[tip_rack1])

	# Should pick tips up column-wise from tiprack1
	for _ in range(12):
		instrument.pick_up_tip()
		instrument.drop_tip()

	# Should raise error. Comment out to fix
	instrument.pick_up_tip()

	######### CHANGE CONFIG TO ALL #########
	instrument.configure_nozzle_layout(style=ALL, tip_racks=[tip_rack2])

	# Should pick all tips up from tiprack2
	instrument.pick_up_tip()
	instrument.drop_tip()

	# Should raise error. Comment out to fix
	instrument.pick_up_tip()

Changelog

  • added a new active_channels getter to get the number of pipette channels that are actually in use
  • updated pick_up_tip and tip update logic to use active channels instead of pipette static channels

Review requests

  • make sure all the tip tracking logic is updated in PAPI & engine
  • test on a robot

Risk assessment

Medium. Affects existing tip tracking logic

@sanni-t sanni-t changed the base branch from edge to chore_release-7.1.0 December 6, 2023 15:52
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Merging #14104 (db5e758) into chore_release-7.1.0 (4aced90) will decrease coverage by 0.01%.
Report is 3 commits behind head on chore_release-7.1.0.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                   @@
##           chore_release-7.1.0   #14104      +/-   ##
=======================================================
- Coverage                70.44%   70.43%   -0.01%     
=======================================================
  Files                     1636     1636              
  Lines                    54470    54470              
  Branches                  4008     4008              
=======================================================
- Hits                     38369    38367       -2     
- Misses                   15407    15408       +1     
- Partials                   694      695       +1     
Flag Coverage Δ
g-code-testing 96.44% <ø> (ø)
notify-server 89.13% <ø> (ø)

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

Files Coverage Δ
...i/src/opentrons/protocol_api/instrument_context.py 89.40% <ø> (ø)
api/src/opentrons/protocol_api/labware.py 91.02% <ø> (ø)
...src/opentrons/protocol_engine/commands/__init__.py 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

@sanni-t sanni-t marked this pull request as ready for review December 6, 2023 16:53
@sanni-t sanni-t requested a review from a team as a code owner December 6, 2023 16:53
@sanni-t
Copy link
Member Author

sanni-t commented Dec 6, 2023

Tested the above protocol on Flex successfully! (Successful = pipette picked up next tips in correct order. Got an unrelated tip sensor error halfway in)

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.

Looks great to me!

Copy link
Member Author

@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.

Comments from in-person review with @jbleon95 @CaseyBatten


def get_active_channels(self) -> int:
"""This will never be called because it was added in API 2.16."""
return 0
Copy link
Member Author

Choose a reason for hiding this comment

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

Do an assert False with error message here instead of returning random number


def get_active_channels(self) -> int:
"""This will never be called because it was added in API 2.16."""
return 0
Copy link
Member Author

Choose a reason for hiding this comment

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

same as above

self._handle_command(action.command)
# TODO: add test for this
Copy link
Member Author

Choose a reason for hiding this comment

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

remove todo

Copy link
Contributor

@CaseyBatten CaseyBatten left a comment

Choose a reason for hiding this comment

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

Held in person review, changes look good, nothing blocking.

@sanni-t sanni-t merged commit f467c31 into chore_release-7.1.0 Dec 6, 2023
25 checks passed
@sanni-t sanni-t deleted the api-tip-tracking-in-partial-tip-config branch July 15, 2024 21:37
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