Skip to content

Commit

Permalink
linting and module_id fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed Dec 23, 2024
1 parent a1fe6a5 commit 0bafe4b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ async def execute(self, params: InitializeParams) -> SuccessData[InitializeResul
)

state_update.initialize_absorbance_reader(
params.moduleId, # should this be the verified id?
abs_reader_substate.module_id,
params.measureMode,
params.sampleWavelengths,
params.referenceWavelength,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async def execute( # noqa: C901
)

state_update.set_absorbance_reader_data(
module_id=params.moduleId, read_result=asbsorbance_result
module_id=abs_reader_substate.module_id, read_result=asbsorbance_result
)
# TODO (cb, 10-17-2024): FILE PROVIDER - Some day we may want to break the file provider behavior into a seperate API function.
# When this happens, we probably will to have the change the command results handler we utilize to track file IDs in engine.
Expand Down
2 changes: 0 additions & 2 deletions api/src/opentrons/protocol_engine/state/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
AbsorbanceReaderMeasureMode,
)
from opentrons.types import DeckSlotName, MountType, StagingSlotName
from opentrons_shared_data.module import types
from ..errors import ModuleNotConnectedError

from ..types import (
Expand Down Expand Up @@ -64,7 +63,6 @@
heater_shaker,
temperature_module,
thermocycler,
absorbance_reader,
)
from ..actions import (
Action,
Expand Down
4 changes: 2 additions & 2 deletions api/src/opentrons/protocol_engine/state/update_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from opentrons.hardware_control.nozzle_manager import NozzleMap
from opentrons.protocol_engine.resources import pipette_data_provider
from opentrons.protocol_engine.resources.file_provider import PlateReaderData
from opentrons.protocol_engine.types import (
DeckPoint,
LabwareLocation,
Expand Down Expand Up @@ -273,6 +272,7 @@ class AbsorbanceReaderInitializeUpdate:

@dataclasses.dataclass
class ModuleStateUpdate:
"""An update to the module state."""
module_id: str
module_type: ModuleType
absorbance_reader_lid: AbsorbanceReaderLidUpdate | NoChangeType = NO_CHANGE
Expand Down Expand Up @@ -613,7 +613,6 @@ def set_absorbance_reader_data(
self, module_id: str, read_result: typing.Dict[int, typing.Dict[str, float]]
) -> Self:
"""Update an absorbance reader's read data. See `AbsorbanceReaderReadDataUpdate`."""

self.module_state_update = ModuleStateUpdate(
module_id=module_id,
module_type="absorbanceReaderType",
Expand All @@ -628,6 +627,7 @@ def initialize_absorbance_reader(
sample_wave_lengths: typing.List[int],
reference_wave_length: typing.Optional[int],
) -> Self:
"""Initialize absorbance reader."""
self.module_state_update = ModuleStateUpdate(
module_id=module_id,
module_type="absorbanceReaderType",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def test_absorbance_reader_implementation(
public=InitializeResult(),
state_update=update_types.StateUpdate(
module_state_update=update_types.ModuleStateUpdate(
module_id="unverified-module-id",
module_id="module-id",
module_type="absorbanceReaderType",
initialize_absorbance_reader_update=update_types.AbsorbanceReaderInitializeUpdate(
measure_mode=input_measure_mode, # type: ignore[arg-type]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Test absorbance reader initilize command."""
import pytest
from decoy import Decoy
from typing import List, Dict

from opentrons.drivers.types import ABSMeasurementMode, ABSMeasurementConfig
from opentrons.hardware_control.modules import AbsorbanceReader
Expand Down Expand Up @@ -80,7 +79,7 @@ async def test_absorbance_reader_implementation(
state_update=update_types.StateUpdate(
files_added=update_types.FilesAddedUpdate(file_ids=[]),
module_state_update=update_types.ModuleStateUpdate(
module_id="unverified-module-id",
module_id="module-id",
module_type="absorbanceReaderType",
absorbance_reader_data=update_types.AbsorbanceReaderDataUpdate(
read_result=asbsorbance_result
Expand Down

0 comments on commit 0bafe4b

Please sign in to comment.