|
18 | 18 | )
|
19 | 19 |
|
20 | 20 | from opentrons_shared_data import get_shared_data_root, load_shared_data
|
21 |
| -from opentrons_shared_data.deck.types import DeckDefinitionV5 |
| 21 | +from opentrons_shared_data.deck.types import DeckDefinitionV5, CutoutFixture |
22 | 22 | from opentrons_shared_data.deck import load as load_deck
|
23 | 23 | from opentrons_shared_data.labware.types import LabwareUri
|
24 | 24 | from opentrons_shared_data.pipette import pipette_definition
|
|
45 | 45 | labware_definition_type_adapter,
|
46 | 46 | )
|
47 | 47 | from opentrons_shared_data.labware import load_definition as load_labware_definition
|
48 |
| - |
49 | 48 | from opentrons.protocol_engine import errors
|
50 | 49 | from opentrons.protocol_engine.types import (
|
51 | 50 | OFF_DECK_LOCATION,
|
|
89 | 88 | OnCutoutFixtureLocationSequenceComponent,
|
90 | 89 | InStackerHopperLocation,
|
91 | 90 | PotentialCutoutFixture,
|
| 91 | + AddressableArea, |
| 92 | + AreaType, |
| 93 | + AddressableOffsetVector, |
92 | 94 | )
|
93 | 95 | from opentrons.protocol_engine.commands import (
|
94 | 96 | CommandStatus,
|
|
134 | 136 | mountOffset,
|
135 | 137 | )
|
136 | 138 |
|
| 139 | + |
137 | 140 | from .command_fixtures import (
|
138 | 141 | create_comment_command,
|
139 | 142 | )
|
@@ -2580,28 +2583,88 @@ def test_get_slot_item(
|
2580 | 2583 | decoy: Decoy,
|
2581 | 2584 | mock_labware_view: LabwareView,
|
2582 | 2585 | mock_module_view: ModuleView,
|
| 2586 | + ot3_standard_deck_def: DeckDefinitionV5, |
2583 | 2587 | subject: GeometryView,
|
2584 | 2588 | ) -> None:
|
2585 | 2589 | """It should get items in certain slots."""
|
2586 | 2590 | labware = LoadedLabware.model_construct(id="cool-labware") # type: ignore[call-arg]
|
2587 | 2591 | module = LoadedModule.model_construct(id="cool-module") # type: ignore[call-arg]
|
| 2592 | + chute_fixture = CutoutFixture( |
| 2593 | + id="wasteChuteRightAdapterNoCover", |
| 2594 | + mayMountTo=["cutoutD3"], |
| 2595 | + providesAddressableAreas={ |
| 2596 | + "cutoutD3": [ |
| 2597 | + "1ChannelWasteChute", |
| 2598 | + "8ChannelWasteChute", |
| 2599 | + "96ChannelWasteChute", |
| 2600 | + "gripperWasteChute", |
| 2601 | + ] |
| 2602 | + }, |
| 2603 | + displayName="Waste Chute Adapter for 96 Channel Pipette or Gripper", |
| 2604 | + fixtureGroup={}, |
| 2605 | + expectOpentronsModuleSerialNumber=False, |
| 2606 | + height=124.5, |
| 2607 | + ) |
| 2608 | + chute_area = AddressableArea( |
| 2609 | + area_name="1ChannelWasteChute", |
| 2610 | + area_type=AreaType.WASTE_CHUTE, |
| 2611 | + base_slot=DeckSlotName.SLOT_D3, |
| 2612 | + display_name="", |
| 2613 | + bounding_box=Dimensions(x=0, y=0, z=0), |
| 2614 | + position=AddressableOffsetVector(x=0, y=0, z=0), |
| 2615 | + compatible_module_types=[], |
| 2616 | + ) |
| 2617 | + subject._addressable_areas = AddressableAreaView( |
| 2618 | + state=AddressableAreaState( |
| 2619 | + loaded_addressable_areas_by_name={ |
| 2620 | + "1ChannelWasteChute": chute_area, |
| 2621 | + }, |
| 2622 | + potential_cutout_fixtures_by_cutout_id={ |
| 2623 | + "cutoutD3": { |
| 2624 | + PotentialCutoutFixture( |
| 2625 | + cutout_id="cutoutD3", |
| 2626 | + cutout_fixture_id="cool_chute", |
| 2627 | + provided_addressable_areas=frozenset({chute_area.area_name}), |
| 2628 | + ) |
| 2629 | + }, |
| 2630 | + "cutoutC3": { |
| 2631 | + PotentialCutoutFixture( |
| 2632 | + cutout_id="cutoutC3", |
| 2633 | + cutout_fixture_id="cool_trash", |
| 2634 | + provided_addressable_areas=frozenset({chute_area.area_name}), |
| 2635 | + ) |
| 2636 | + }, |
| 2637 | + }, |
| 2638 | + deck_definition=ot3_standard_deck_def, |
| 2639 | + deck_configuration=[ |
| 2640 | + ("cutoutC1", "singleLeftSlot", None), |
| 2641 | + ("cutoutD1", "singleLeftSlot", None), |
| 2642 | + ("cutoutD2", "singleCenterSlot", None), |
| 2643 | + ("cutoutD3", "wasteChuteRightAdapterNoCover", None), |
| 2644 | + ], |
| 2645 | + robot_type=subject._addressable_areas._state.robot_type, |
| 2646 | + use_simulated_deck_config=subject._addressable_areas._state.use_simulated_deck_config, |
| 2647 | + robot_definition=subject._addressable_areas._state.robot_definition, |
| 2648 | + ) |
| 2649 | + ) |
2588 | 2650 |
|
2589 |
| - decoy.when(mock_labware_view.get_by_slot(DeckSlotName.SLOT_1)).then_return(None) |
2590 |
| - decoy.when(mock_labware_view.get_by_slot(DeckSlotName.SLOT_2)).then_return(labware) |
2591 |
| - decoy.when(mock_labware_view.get_by_slot(DeckSlotName.SLOT_3)).then_return(None) |
| 2651 | + decoy.when(mock_labware_view.get_by_slot(DeckSlotName.SLOT_D1)).then_return(None) |
| 2652 | + decoy.when(mock_labware_view.get_by_slot(DeckSlotName.SLOT_D2)).then_return(labware) |
| 2653 | + decoy.when(mock_labware_view.get_by_slot(DeckSlotName.SLOT_C1)).then_return(None) |
2592 | 2654 |
|
2593 |
| - decoy.when(mock_module_view.get_by_slot(DeckSlotName.SLOT_1)).then_return(None) |
2594 |
| - decoy.when(mock_module_view.get_by_slot(DeckSlotName.SLOT_2)).then_return(None) |
2595 |
| - decoy.when(mock_module_view.get_by_slot(DeckSlotName.SLOT_3)).then_return(module) |
| 2655 | + decoy.when(mock_module_view.get_by_slot(DeckSlotName.SLOT_D1)).then_return(module) |
| 2656 | + decoy.when(mock_module_view.get_by_slot(DeckSlotName.SLOT_D2)).then_return(None) |
| 2657 | + decoy.when(mock_module_view.get_by_slot(DeckSlotName.SLOT_C1)).then_return(None) |
2596 | 2658 |
|
2597 | 2659 | assert (
|
2598 | 2660 | subject.get_slot_item(
|
2599 |
| - DeckSlotName.SLOT_1, |
| 2661 | + DeckSlotName.SLOT_C1, |
2600 | 2662 | )
|
2601 | 2663 | is None
|
2602 | 2664 | )
|
2603 |
| - assert subject.get_slot_item(DeckSlotName.SLOT_2) == labware |
2604 |
| - assert subject.get_slot_item(DeckSlotName.SLOT_3) == module |
| 2665 | + assert subject.get_slot_item(DeckSlotName.SLOT_D2) == labware |
| 2666 | + assert subject.get_slot_item(DeckSlotName.SLOT_D1) == module |
| 2667 | + assert subject.get_slot_item(DeckSlotName.SLOT_D3) == chute_fixture |
2605 | 2668 |
|
2606 | 2669 |
|
2607 | 2670 | def test_get_slot_item_that_is_overflowed_module(
|
|
0 commit comments