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): Filter out air_gap() calls as higher-order commands #14985

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__(self, wrapping_exc: BaseException) -> None:
legacy_command_types.DISTRIBUTE,
legacy_command_types.TRANSFER,
legacy_command_types.RETURN_TIP,
legacy_command_types.AIR_GAP,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"""
from datetime import datetime
from pathlib import Path
from textwrap import dedent
from typing import List

import pytest
Expand Down Expand Up @@ -753,3 +754,46 @@ async def test_zero_volume_dispense_commands(
labwareId=load_well_plate.result.labwareId,
wellName="D7",
)


async def test_air_gap(tmp_path: Path) -> None:
"""An `air_gap()` should be mapped to an `aspirate`.

This covers RQA-2621.
"""
path = tmp_path / "protocol.py"
path.write_text(
dedent(
"""\
metadata = {"apiLevel": "2.13"}
def run(protocol):
# Prep:
tip_rack = protocol.load_labware("opentrons_96_tiprack_300ul", 1)
well_plate = protocol.load_labware("biorad_96_wellplate_200ul_pcr", 2)
pipette = protocol.load_instrument("p300_single_gen2", mount="left", tip_racks=[tip_rack])
pipette.pick_up_tip()

# Test:
pipette.move_to(well_plate["A1"].top())
pipette.air_gap(100)
"""
)
)
result_commands = await simulate_and_get_commands(path)
[
initial_home,
load_tip_rack,
load_well_plate,
load_pipette,
pick_up_tip,
move_to_well,
air_gap_aspirate,
] = result_commands
assert isinstance(initial_home, commands.Home)
assert isinstance(load_tip_rack, commands.LoadLabware)
assert isinstance(load_well_plate, commands.LoadLabware)
assert isinstance(load_pipette, commands.LoadPipette)
assert isinstance(pick_up_tip, commands.PickUpTip)
# TODO(mm, 2024-04-23): This commands.Custom looks wrong. This should be a commands.MoveToWell.
Copy link
Member

Choose a reason for hiding this comment

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

👀
Might be worth ticketing out if it looks like another bug.

assert isinstance(move_to_well, commands.Custom)
assert isinstance(air_gap_aspirate, commands.Aspirate)
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@ def test_map_pause() -> None:
"command.DISTRIBUTE",
"command.TRANSFER",
"command.RETURN_TIP",
"command.AIR_GAP",
],
)
def test_filter_higher_order_commands(command_type: str) -> None:
Expand Down
Loading