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(shared-data): add liquid class definition for water #16671

Draft
wants to merge 2 commits into
base: edge
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -15,39 +15,36 @@ def test_liquid_class_creation_and_property_fetching(
decoy.when(ff.allow_liquid_classes(RobotTypeEnum.OT2)).then_return(True)
protocol_context = simulate.get_protocol_api(version="2.20", robot_type="OT-2")
pipette_left = protocol_context.load_instrument("p20_single_gen2", mount="left")
pipette_right = protocol_context.load_instrument("p300_multi", mount="right")
tiprack = protocol_context.load_labware("opentrons_96_tiprack_20ul", "1")

glycerol_50 = protocol_context.define_liquid_class("fixture_glycerol50")
water = protocol_context.define_liquid_class("water")

assert glycerol_50.name == "fixture_glycerol50"
assert glycerol_50.display_name == "Glycerol 50%"
assert water.name == "water"
assert water.display_name == "Water"

# TODO (spp, 2024-10-17): update this to use pipette's load name instead of pipette.name
assert (
glycerol_50.get_for(
pipette_left.name, tiprack.load_name
).dispense.flowRateByVolume["default"]
water.get_for(pipette_left.name, tiprack.load_name).dispense.flowRateByVolume[
"default"
]
== 50
)
assert (
glycerol_50.get_for(
pipette_left.name, tiprack.load_name
).aspirate.submerge.speed
water.get_for(pipette_left.name, tiprack.load_name).aspirate.submerge.speed
== 100
)

with pytest.raises(
ValueError,
match="No properties found for p300_multi in fixture_glycerol50 liquid class",
match="No properties found for non-existent-pipette in water liquid class",
):
glycerol_50.get_for(pipette_right.name, tiprack.load_name)
water.get_for("non-existent-pipette", tiprack.load_name)

with pytest.raises(AttributeError):
glycerol_50.name = "foo" # type: ignore
water.name = "foo" # type: ignore

with pytest.raises(AttributeError):
glycerol_50.display_name = "bar" # type: ignore
water.display_name = "bar" # type: ignore

with pytest.raises(ValueError, match="Liquid class definition not found"):
protocol_context.define_liquid_class("non-existent-liquid")
Expand All @@ -57,4 +54,4 @@ def test_liquid_class_feature_flag() -> None:
"""It should raise a not implemented error without the allowLiquidClass flag set."""
protocol_context = simulate.get_protocol_api(version="2.20", robot_type="OT-2")
with pytest.raises(NotImplementedError):
protocol_context.define_liquid_class("fixture_glycerol50")
protocol_context.define_liquid_class("water")
Loading
Loading