-
Notifications
You must be signed in to change notification settings - Fork 178
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
refactor(api): Save full nozzle map configuration and update state store accordingly #14529
Changes from all commits
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 |
---|---|---|
@@ -1,20 +1,17 @@ | ||
"""Test pipette data provider.""" | ||
from collections import OrderedDict | ||
|
||
import pytest | ||
from opentrons_shared_data.pipette.dev_types import PipetteNameType, PipetteModel | ||
from opentrons_shared_data.pipette import pipette_definition, types as pip_types | ||
|
||
from opentrons.hardware_control.dev_types import PipetteDict | ||
from opentrons.hardware_control.nozzle_manager import NozzleMap | ||
from opentrons.protocol_engine.types import FlowRates | ||
from opentrons.protocol_engine.resources.pipette_data_provider import ( | ||
LoadedStaticPipetteData, | ||
VirtualPipetteDataProvider, | ||
) | ||
|
||
from opentrons.protocol_engine.resources import pipette_data_provider as subject | ||
from opentrons.types import Point | ||
from ..pipette_fixtures import get_default_nozzle_map | ||
|
||
|
||
@pytest.fixture | ||
|
@@ -54,8 +51,7 @@ def test_get_virtual_pipette_static_config( | |
"opentrons/opentrons_96_tiprack_10ul/1": 8.25, | ||
"opentrons/opentrons_96_tiprack_20ul/1": 8.25, | ||
}, | ||
back_left_nozzle_offset=Point(x=0.0, y=0.0, z=10.45), | ||
front_right_nozzle_offset=Point(x=0.0, y=0.0, z=10.45), | ||
nozzle_map=result.nozzle_map, | ||
) | ||
|
||
|
||
|
@@ -81,8 +77,7 @@ def test_configure_virtual_pipette_for_volume( | |
), | ||
tip_configuration_lookup_table=result1.tip_configuration_lookup_table, | ||
nominal_tip_overlap=result1.nominal_tip_overlap, | ||
back_left_nozzle_offset=Point(x=-8.0, y=-22.0, z=-259.15), | ||
front_right_nozzle_offset=Point(x=-8.0, y=-22.0, z=-259.15), | ||
nozzle_map=result1.nozzle_map, | ||
Comment on lines
78
to
+80
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. Hmm, just realizing these aren't great asserts. They're just comparing an item with itself; like |
||
) | ||
subject_instance.configure_virtual_pipette_for_volume( | ||
"my-pipette", 1, result1.model | ||
|
@@ -105,8 +100,7 @@ def test_configure_virtual_pipette_for_volume( | |
), | ||
tip_configuration_lookup_table=result2.tip_configuration_lookup_table, | ||
nominal_tip_overlap=result2.nominal_tip_overlap, | ||
back_left_nozzle_offset=Point(x=-8.0, y=-22.0, z=-259.15), | ||
front_right_nozzle_offset=Point(x=-8.0, y=-22.0, z=-259.15), | ||
nozzle_map=result2.nozzle_map, | ||
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. same as above |
||
) | ||
|
||
|
||
|
@@ -132,8 +126,7 @@ def test_load_virtual_pipette_by_model_string( | |
), | ||
tip_configuration_lookup_table=result.tip_configuration_lookup_table, | ||
nominal_tip_overlap=result.nominal_tip_overlap, | ||
back_left_nozzle_offset=Point(x=0.0, y=31.5, z=35.52), | ||
front_right_nozzle_offset=Point(x=0.0, y=-31.5, z=35.52), | ||
nozzle_map=result.nozzle_map, | ||
) | ||
|
||
|
||
|
@@ -179,6 +172,7 @@ def test_get_pipette_static_config( | |
supported_tip_fixture: pipette_definition.SupportedTipsDefinition, | ||
) -> None: | ||
"""It should return config data given a PipetteDict.""" | ||
dummy_nozzle_map = get_default_nozzle_map(PipetteNameType.P300_SINGLE_GEN2) | ||
pipette_dict: PipetteDict = { | ||
"name": "p300_single_gen2", | ||
"min_volume": 20, | ||
|
@@ -214,14 +208,7 @@ def test_get_pipette_static_config( | |
"default_aspirate_speeds": {"2.0": 5.021202, "2.6": 10.042404}, | ||
"default_push_out_volume": 3, | ||
"supported_tips": {pip_types.PipetteTipType.t300: supported_tip_fixture}, | ||
"current_nozzle_map": NozzleMap.build( | ||
physical_nozzles=OrderedDict({"A1": Point(1, 2, 3), "B1": Point(4, 5, 6)}), | ||
physical_rows=OrderedDict({"A": ["A1"], "B": ["B1"]}), | ||
physical_columns=OrderedDict({"1": ["A1", "B1"]}), | ||
starting_nozzle="A1", | ||
back_left_nozzle="A1", | ||
front_right_nozzle="B1", | ||
), | ||
"current_nozzle_map": dummy_nozzle_map, | ||
} | ||
|
||
result = subject.get_pipette_static_config(pipette_dict) | ||
|
@@ -247,6 +234,5 @@ def test_get_pipette_static_config( | |
# https://opentrons.atlassian.net/browse/RCORE-655 | ||
nozzle_offset_z=0, | ||
home_position=0, | ||
back_left_nozzle_offset=Point(x=1, y=2, z=3), | ||
front_right_nozzle_offset=Point(x=4, y=5, z=6), | ||
nozzle_map=dummy_nozzle_map, | ||
) |
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.
Can we make
nozzle_configuration_by_id
values non-Optional
now?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.
Discussed with @Laura-Danielle. We'll defer this change. Might want to leave a
# TODO
explaining what needs to happen, though.