-
Notifications
You must be signed in to change notification settings - Fork 199
feat(api): add per destination option to LC based transfer #18261
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
Changes from all commits
4900b68
21d626d
73a91d3
6e3c149
86d5200
95902f6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -233,10 +233,128 @@ def test_order_of_water_transfer_steps( | |
| alternate_tip_drop=True, | ||
| ), | ||
| ] | ||
| assert len(mock_manager.mock_calls) == 9 | ||
| assert mock_manager.mock_calls == expected_calls | ||
|
|
||
|
|
||
| @pytest.mark.ot3_only | ||
| @pytest.mark.parametrize( | ||
| "simulated_protocol_context", [("2.23", "Flex")], indirect=True | ||
| ) | ||
| def test_order_of_water_transfer_steps_with_new_tip_per_destination( | ||
| simulated_protocol_context: ProtocolContext, | ||
| ) -> None: | ||
| """It should run the transfer steps while picking up a new tip only for a new destination.""" | ||
| trash = simulated_protocol_context.load_trash_bin("A3") | ||
| tiprack = simulated_protocol_context.load_labware( | ||
| "opentrons_flex_96_tiprack_50ul", "D1" | ||
| ) | ||
| pipette_50 = simulated_protocol_context.load_instrument( | ||
| "flex_1channel_50", mount="left", tip_racks=[tiprack] | ||
| ) | ||
| nest_plate = simulated_protocol_context.load_labware( | ||
| "nest_96_wellplate_200ul_flat", "C3" | ||
| ) | ||
|
|
||
| water = simulated_protocol_context.define_liquid_class("water") | ||
| with ( | ||
| mock.patch.object( | ||
| InstrumentCore, | ||
| "pick_up_tip", | ||
| side_effect=InstrumentCore.pick_up_tip, | ||
| autospec=True, | ||
| ) as patched_pick_up_tip, | ||
| mock.patch.object( | ||
| InstrumentCore, | ||
| "aspirate_liquid_class", | ||
| side_effect=InstrumentCore.aspirate_liquid_class, | ||
| autospec=True, | ||
| ) as patched_aspirate, | ||
| mock.patch.object( | ||
| InstrumentCore, | ||
| "dispense_liquid_class", | ||
| side_effect=InstrumentCore.dispense_liquid_class, | ||
| autospec=True, | ||
| ) as patched_dispense, | ||
| mock.patch.object( | ||
| InstrumentCore, | ||
| "drop_tip_in_disposal_location", | ||
| side_effect=InstrumentCore.drop_tip_in_disposal_location, | ||
| autospec=True, | ||
| ) as patched_drop_tip, | ||
| ): | ||
| mock_manager = mock.Mock() | ||
| mock_manager.attach_mock(patched_pick_up_tip, "pick_up_tip") | ||
| mock_manager.attach_mock(patched_aspirate, "aspirate_liquid_class") | ||
| mock_manager.attach_mock(patched_dispense, "dispense_liquid_class") | ||
| mock_manager.attach_mock(patched_drop_tip, "drop_tip_in_disposal_location") | ||
| pipette_50.transfer_with_liquid_class( | ||
| liquid_class=water, | ||
| volume=60, | ||
| source=nest_plate.rows()[0][:2], | ||
| dest=nest_plate.rows()[1][:2], | ||
| new_tip="per destination", | ||
| trash_location=trash, | ||
| ) | ||
| expected_calls_per_tip = [ | ||
| mock.call.pick_up_tip( | ||
| mock.ANY, | ||
| location=mock.ANY, | ||
| well_core=mock.ANY, | ||
| presses=mock.ANY, | ||
| increment=mock.ANY, | ||
| ), | ||
| mock.call.aspirate_liquid_class( | ||
| mock.ANY, | ||
| volume=30, | ||
| source=mock.ANY, | ||
| transfer_properties=mock.ANY, | ||
| transfer_type=TransferType.ONE_TO_ONE, | ||
| tip_contents=[LiquidAndAirGapPair(liquid=0, air_gap=0)], | ||
| volume_for_pipette_mode_configuration=30, | ||
| ), | ||
| mock.call.dispense_liquid_class( | ||
| mock.ANY, | ||
| volume=30, | ||
| dest=mock.ANY, | ||
| source=mock.ANY, | ||
| transfer_properties=mock.ANY, | ||
| transfer_type=TransferType.ONE_TO_ONE, | ||
| tip_contents=[LiquidAndAirGapPair(liquid=30, air_gap=0.1)], | ||
| add_final_air_gap=True, | ||
| trash_location=mock.ANY, | ||
| ), | ||
| mock.call.aspirate_liquid_class( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey, what is this test supposed to do? If there are 2 destination wells, should it have picked up tips twice if you said
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, and it does. This list is 'expected calls per tip'. The assert in the bottom checks that there's two calls. I didn't want to add 50 more lines duplicating the calls if I could avoid it. |
||
| mock.ANY, | ||
| volume=30, | ||
| source=mock.ANY, | ||
| transfer_properties=mock.ANY, | ||
| transfer_type=TransferType.ONE_TO_ONE, | ||
| tip_contents=[LiquidAndAirGapPair(liquid=0, air_gap=0.1)], | ||
| volume_for_pipette_mode_configuration=30, | ||
| ), | ||
| mock.call.dispense_liquid_class( | ||
| mock.ANY, | ||
| volume=30, | ||
| dest=mock.ANY, | ||
| source=mock.ANY, | ||
| transfer_properties=mock.ANY, | ||
| transfer_type=TransferType.ONE_TO_ONE, | ||
| tip_contents=[LiquidAndAirGapPair(liquid=30, air_gap=0.1)], | ||
| add_final_air_gap=True, | ||
| trash_location=mock.ANY, | ||
| ), | ||
| mock.call.drop_tip_in_disposal_location( | ||
| mock.ANY, | ||
| disposal_location=trash, | ||
| home_after=False, | ||
| alternate_tip_drop=True, | ||
| ), | ||
| ] | ||
| assert ( | ||
| mock_manager.mock_calls == expected_calls_per_tip + expected_calls_per_tip | ||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.ot3_only | ||
| @pytest.mark.parametrize( | ||
| "simulated_protocol_context", [("2.23", "Flex")], indirect=True | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine. But since you have an
andhere, is there ever a case whereprev_sourceisNonebutprev_destis notNone?