-
Notifications
You must be signed in to change notification settings - Fork 179
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(app, api, shared-data, robot-server): Add module fixtures to deck configuration #14684
Changes from 9 commits
3776fdf
c36543f
bceeb45
ecccea0
7f110f6
110c745
aca73c4
a8b71f9
934b28a
64b5208
46655e2
9e4b15c
0ef5d70
b42ca46
93ff8af
de28cbe
28fd16e
26e64bd
4ebcade
1bbd44c
06b8f18
ea51ac1
a5539a6
577d709
9ed5339
7a146f0
a966d37
0974d69
c62525c
93ef32f
d86ce7b
32981d9
b69fdc8
35355e9
696029e
4ea0518
1977256
b2783ca
746600e
0fc0f57
1d5aaee
2b4ddd9
f809136
2c8fe4a
ce8f7b3
2df67ee
76a4ca9
c7bedcd
33baf87
2dce8f3
3e52951
b8697eb
4bc2e97
3d038a5
562b448
65582a6
52a60e8
38a5a9c
4e911c7
d1cc543
4b842ff
c8fa3fd
6f945ff
a72a4a5
c0b29c1
c80c04b
921ef43
3014bc8
cc3bc10
2a5daa6
711ba14
7908112
4f4510f
ce3116c
584986f
12e7aed
8afeef6
44ec408
2fc5e1c
38bde3f
43b483d
38133e9
b7e50a5
a411009
ad69388
0c1759b
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,7 +1,7 @@ | ||
import logging | ||
from typing import Dict, List, Optional, Set, Union, cast, Tuple | ||
|
||
from opentrons_shared_data.deck.dev_types import DeckDefinitionV4, SlotDefV3 | ||
from opentrons_shared_data.deck.dev_types import DeckDefinitionV5, SlotDefV3 | ||
from opentrons_shared_data.labware.dev_types import LabwareDefinition | ||
from opentrons_shared_data.pipette.dev_types import PipetteNameType | ||
from opentrons_shared_data.robot.dev_types import RobotType | ||
|
@@ -288,6 +288,7 @@ def load_module( | |
model: ModuleModel, | ||
deck_slot: Optional[DeckSlotName], | ||
configuration: Optional[str], | ||
addressable_area: Optional[str], | ||
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. this seems extraneous right? we aren't really loading a module into an addressable area. It's more that we're loading it into a cutout right? 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. Could be moved elsewhere potentially. Right now the logic flow is:
I could probably collapse this down to occur inside the engine-side load_module logic instead if we want. |
||
) -> legacy_module_core.LegacyModuleCore: | ||
"""Load a module.""" | ||
resolved_type = ModuleType.from_model(model) | ||
|
@@ -491,7 +492,7 @@ def get_labware_on_labware( | |
) -> Optional[LegacyLabwareCore]: | ||
assert False, "get_labware_on_labware only supported on engine core" | ||
|
||
def get_deck_definition(self) -> DeckDefinitionV4: | ||
def get_deck_definition(self) -> DeckDefinitionV5: | ||
"""Get the geometry definition of the robot's deck.""" | ||
assert False, "get_deck_definition only supported on engine core" | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -87,6 +87,10 @@ class InvalidTrashBinLocationError(ValueError): | |||||
"""An error raised when attempting to load trash bins in invalid slots.""" | ||||||
|
||||||
|
||||||
class InvalidFixtureLocationError(ValueError): | ||||||
"""An error raised when attempting to load a fixture in an invalid cutout.""" | ||||||
|
||||||
|
||||||
def ensure_mount_for_pipette( | ||||||
mount: Union[str, Mount, None], pipette: PipetteNameType | ||||||
) -> Mount: | ||||||
|
@@ -332,6 +336,109 @@ def ensure_and_convert_trash_bin_location( | |||||
return map_trash_bin_addressable_area[slot_name_ot3] | ||||||
|
||||||
|
||||||
def ensure_and_convert_module_fixture_location( | ||||||
deck_slot: Optional[Union[int, str]], | ||||||
api_version: APIVersion, | ||||||
robot_type: RobotType, | ||||||
model: ModuleModel, | ||||||
) -> Optional[str]: | ||||||
"""Ensure module fixture load location is valid. | ||||||
|
||||||
Also, convert the deck slot to a valid module fixture addressable area. | ||||||
""" | ||||||
|
||||||
if robot_type == "OT-2 Standard": | ||||||
# OT-2 Utilizes the existing compatibleModulelTypes list of traditional addressable areas | ||||||
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.
Suggested change
|
||||||
return None | ||||||
|
||||||
if isinstance(model, MagneticBlockModel): | ||||||
valid_slots = [ | ||||||
DeckSlotName(slot) | ||||||
for slot in [ | ||||||
"A1", | ||||||
"B1", | ||||||
"C1", | ||||||
"D1", | ||||||
"A2", | ||||||
"B2", | ||||||
"C2", | ||||||
"D2", | ||||||
"A3", | ||||||
"B3", | ||||||
"C3", | ||||||
"D3", | ||||||
] | ||||||
] | ||||||
addressable_areas = [ | ||||||
"magneticBlockV1A1", | ||||||
"magneticBlockV1B1", | ||||||
"magneticBlockV1C1", | ||||||
"magneticBlockV1D1", | ||||||
"magneticBlockV1A2", | ||||||
"magneticBlockV1B2", | ||||||
"magneticBlockV1C2", | ||||||
"magneticBlockV1D2", | ||||||
"magneticBlockV1A3", | ||||||
"magneticBlockV1B3", | ||||||
"magneticBlockV1C3", | ||||||
"magneticBlockV1D3", | ||||||
] | ||||||
|
||||||
elif isinstance(model, HeaterShakerModuleModel): | ||||||
valid_slots = [ | ||||||
DeckSlotName(slot) | ||||||
for slot in ["A1", "B1", "C1", "D1", "A3", "B3", "C3", "D3"] | ||||||
] | ||||||
addressable_areas = [ | ||||||
"heaterShakerV1A1", | ||||||
"heaterShakerV1B1", | ||||||
"heaterShakerV1C1", | ||||||
"heaterShakerV1D1", | ||||||
"heaterShakerV1A3", | ||||||
"heaterShakerV1B3", | ||||||
"heaterShakerV1C3", | ||||||
"heaterShakerV1D3", | ||||||
] | ||||||
elif isinstance(model, TemperatureModuleModel): | ||||||
valid_slots = [ | ||||||
DeckSlotName(slot) | ||||||
for slot in ["A1", "B1", "C1", "D1", "A3", "B3", "C3", "D3"] | ||||||
] | ||||||
addressable_areas = [ | ||||||
"temperatureModuleV2A1", | ||||||
"temperatureModuleV2B1", | ||||||
"temperatureModuleV2C1", | ||||||
"temperatureModuleV2D1", | ||||||
"temperatureModuleV2A3", | ||||||
"temperatureModuleV2B3", | ||||||
"temperatureModuleV2C3", | ||||||
"temperatureModuleV2D3", | ||||||
] | ||||||
elif isinstance(model, ThermocyclerModuleModel): | ||||||
return "thermocyclerModuleV2" | ||||||
else: | ||||||
return None | ||||||
|
||||||
map_addressable_area = { | ||||||
slot: addressable_area | ||||||
for slot, addressable_area in zip(valid_slots, addressable_areas) | ||||||
} | ||||||
if isinstance(deck_slot, int) or isinstance(deck_slot, str): | ||||||
slot_name_ot3 = ensure_and_convert_deck_slot(deck_slot, api_version, robot_type) | ||||||
if not isinstance(slot_name_ot3, DeckSlotName): | ||||||
raise ValueError("Staging areas not permitted for module fixtures.") | ||||||
if slot_name_ot3 not in valid_slots: | ||||||
raise InvalidFixtureLocationError( | ||||||
f"Invalid location: {slot_name_ot3} for fixture: {model.name}." | ||||||
) | ||||||
|
||||||
return map_addressable_area[slot_name_ot3] | ||||||
else: | ||||||
raise ValueError( | ||||||
"Location must be provided when loading modules except for the Thermocycler." | ||||||
) | ||||||
|
||||||
|
||||||
def ensure_hold_time_seconds( | ||||||
seconds: Optional[float], minutes: Optional[float] | ||||||
) -> float: | ||||||
|
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.
looks like these cutout fixture ids still need the model versions added in