Skip to content

Commit

Permalink
Quick hack to load lid definition into engine.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Nov 7, 2024
1 parent 83c5f52 commit b6f7762
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 13 additions & 1 deletion api/src/opentrons/protocol_engine/create_protocol_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
from opentrons.protocol_engine.execution.error_recovery_hardware_state_synchronizer import (
ErrorRecoveryHardwareStateSynchronizer,
)
from opentrons.protocol_engine.resources.labware_data_provider import (
LabwareDataProvider,
)
from opentrons.util.async_helpers import async_context_manager_in_thread

from opentrons_shared_data.robot import load as load_robot
Expand Down Expand Up @@ -81,7 +84,7 @@ async def create_protocol_engine(
module_data_provider = ModuleDataProvider()
file_provider = file_provider or FileProvider()

return ProtocolEngine(
pe = ProtocolEngine(
hardware_api=hardware_api,
state_store=state_store,
action_dispatcher=action_dispatcher,
Expand All @@ -93,6 +96,15 @@ async def create_protocol_engine(
file_provider=file_provider,
)

# FIX BEFORE MERGE: Something less implicit than this
pe.add_labware_definition(
await LabwareDataProvider().get_labware_definition(
"opentrons_flex_lid_absorbance_plate_reader_module", "opentrons", 1
)
)

return pe


@contextlib.contextmanager
def create_protocol_engine_in_thread(
Expand Down
6 changes: 4 additions & 2 deletions api/src/opentrons/protocol_engine/state/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,8 +940,10 @@ def get_deck_default_gripper_offsets(self) -> Optional[LabwareMovementOffsetData
)

def get_absorbance_reader_lid_definition(self) -> LabwareDefinition:
# TODO
raise NotImplementedError
# FIX BEFORE MERGE: Avoid hard-coding URI
return self._state.definitions_by_uri[
"opentrons/opentrons_flex_lid_absorbance_plate_reader_module/1"
]

@overload
def get_child_gripper_offsets(
Expand Down

0 comments on commit b6f7762

Please sign in to comment.