Skip to content

Commit

Permalink
Merge branch 'edge' into testing-v8-1-0-liquid-classes-cv
Browse files Browse the repository at this point in the history
  • Loading branch information
andySigler committed Dec 20, 2024
2 parents 221f91d + 3db0e4f commit 1973bbb
Show file tree
Hide file tree
Showing 129 changed files with 2,063 additions and 694 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,32 @@ module.exports = {
files: ['./protocol-designer/src/**/*.@(ts|tsx)'],
rules: {
'opentrons/no-imports-up-the-tree-of-life': 'warn',
'opentrons/no-margins-in-css': 'warn',
'opentrons/no-margins-inline': 'warn',
},
},
// apply application structure import requirements to app
{
files: ['./app/src/**/*.@(ts|tsx)'],
rules: {
'opentrons/no-imports-across-applications': 'error',
'opentrons/no-margins-in-css': 'warn',
'opentrons/no-margins-inline': 'warn',
},
},
{
files: ['./opentrons-ai-client/src/**/*.@(ts|tsx)'],
rules: {
'opentrons/no-imports-up-the-tree-of-life': 'warn',
'opentrons/no-margins-in-css': 'warn',
'opentrons/no-margins-inline': 'warn',
},
},
{
files: ['./components/src/**/*.@(ts|tsx)'],
rules: {
'opentrons/no-margins-in-css': 'warn',
'opentrons/no-margins-inline': 'warn',
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,7 @@ def _build_attached_pip(
converted_name.pipette_type,
converted_name.pipette_channels,
converted_name.pipette_version,
converted_name.oem_type,
),
"id": OT3Controller._combine_serial_number(attached),
}
Expand Down
3 changes: 3 additions & 0 deletions api/src/opentrons/hardware_control/backends/ot3simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,7 @@ def _attached_pipette_to_mount(
converted_name.pipette_type,
converted_name.pipette_channels,
converted_name.pipette_version,
converted_name.oem_type,
),
"id": None,
}
Expand All @@ -533,6 +534,7 @@ def _attached_pipette_to_mount(
converted_name.pipette_type,
converted_name.pipette_channels,
converted_name.pipette_version,
converted_name.oem_type,
),
"id": init_instr["id"],
}
Expand All @@ -544,6 +546,7 @@ def _attached_pipette_to_mount(
converted_name.pipette_type,
converted_name.pipette_channels,
converted_name.pipette_version,
converted_name.oem_type,
),
"id": None,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
UlPerMmAction,
PipetteName,
PipetteModel,
PipetteOEMType,
)
from opentrons.hardware_control.dev_types import InstrumentHardwareConfigs

Expand Down Expand Up @@ -112,17 +113,20 @@ def __init__(
pipette_type=config.pipette_type,
pipette_channels=config.channels,
pipette_generation=config.display_category,
oem_type=PipetteOEMType.OT,
)
self._acting_as = self._pipette_name
self._pipette_model = PipetteModelVersionType(
pipette_type=config.pipette_type,
pipette_channels=config.channels,
pipette_version=config.version,
oem_type=PipetteOEMType.OT,
)
self._valid_nozzle_maps = load_pipette_data.load_valid_nozzle_maps(
self._pipette_model.pipette_type,
self._pipette_model.pipette_channels,
self._pipette_model.pipette_version,
PipetteOEMType.OT,
)
self._nozzle_offset = self._config.nozzle_offset
self._nozzle_manager = (
Expand Down Expand Up @@ -189,7 +193,7 @@ def act_as(self, name: PipetteNameType) -> None:
], f"{self.name} is not back-compatible with {name}"

liquid_model = load_pipette_data.load_liquid_model(
name.pipette_type, name.pipette_channels, name.get_version()
name.pipette_type, name.pipette_channels, name.get_version(), name.oem_type
)
# TODO need to grab name config here to deal with act as test
self._liquid_class.max_volume = liquid_model["default"].max_volume
Expand Down Expand Up @@ -280,6 +284,7 @@ def reload_configurations(self) -> None:
self._pipette_model.pipette_type,
self._pipette_model.pipette_channels,
self._pipette_model.pipette_version,
self._pipette_model.oem_type,
)
self._config_as_dict = self._config.model_dump()

Expand Down
6 changes: 6 additions & 0 deletions api/src/opentrons/hardware_control/instruments/ot3/pipette.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
PipetteName,
PipetteModel,
Quirks,
PipetteOEMType,
)
from opentrons_shared_data.pipette import (
load_data as load_pipette_data,
Expand Down Expand Up @@ -93,22 +94,26 @@ def __init__(
self._liquid_class_name = pip_types.LiquidClasses.default
self._liquid_class = self._config.liquid_properties[self._liquid_class_name]

oem = PipetteOEMType.get_oem_from_quirks(config.quirks)
# TODO (lc 12-05-2022) figure out how we can safely deprecate "name" and "model"
self._pipette_name = PipetteNameType(
pipette_type=config.pipette_type,
pipette_channels=config.channels,
pipette_generation=config.display_category,
oem_type=oem,
)
self._acting_as = self._pipette_name
self._pipette_model = PipetteModelVersionType(
pipette_type=config.pipette_type,
pipette_channels=config.channels,
pipette_version=config.version,
oem_type=oem,
)
self._valid_nozzle_maps = load_pipette_data.load_valid_nozzle_maps(
self._pipette_model.pipette_type,
self._pipette_model.pipette_channels,
self._pipette_model.pipette_version,
self._pipette_model.oem_type,
)
self._nozzle_offset = self._config.nozzle_offset
self._nozzle_manager = (
Expand Down Expand Up @@ -250,6 +255,7 @@ def reload_configurations(self) -> None:
self._pipette_model.pipette_type,
self._pipette_model.pipette_channels,
self._pipette_model.pipette_version,
self._pipette_model.oem_type,
)
self._config_as_dict = self._config.model_dump()

Expand Down
1 change: 1 addition & 0 deletions api/src/opentrons/protocol_api/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"flex_8channel_50": PipetteNameType.P50_MULTI_FLEX,
"flex_1channel_1000": PipetteNameType.P1000_SINGLE_FLEX,
"flex_8channel_1000": PipetteNameType.P1000_MULTI_FLEX,
"flex_8channel_1000_em": PipetteNameType.P1000_MULTI_EM,
"flex_96channel_1000": PipetteNameType.P1000_96,
"flex_96channel_200": PipetteNameType.P200_96,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def configure_virtual_pipette_nozzle_layout(
config.pipette_type,
config.channels,
config.version,
pip_types.PipetteOEMType.OT,
)
new_nozzle_manager = NozzleConfigurationManager.build_from_config(
config, valid_nozzle_maps
Expand Down Expand Up @@ -130,6 +131,7 @@ def configure_virtual_pipette_for_volume(
pipette_model.pipette_type,
pipette_model.pipette_channels,
pipette_model.pipette_version,
pipette_model.oem_type,
)

liquid_class = pipette_definition.liquid_class_for_volume_between_default_and_defaultlowvolume(
Expand Down Expand Up @@ -163,6 +165,7 @@ def _get_virtual_pipette_full_config_by_model_string(
pipette_model.pipette_type,
pipette_model.pipette_channels,
pipette_model.pipette_version,
pipette_model.oem_type,
)

def _get_virtual_pipette_static_config_by_model( # noqa: C901
Expand All @@ -179,6 +182,7 @@ def _get_virtual_pipette_static_config_by_model( # noqa: C901
pipette_model.pipette_type,
pipette_model.pipette_channels,
pipette_model.pipette_version,
pipette_model.oem_type,
)
try:
tip_type = pip_types.PipetteTipType(
Expand All @@ -195,6 +199,7 @@ def _get_virtual_pipette_static_config_by_model( # noqa: C901
pipette_model.pipette_type,
pipette_model.pipette_channels,
pipette_model.pipette_version,
pipette_model.oem_type,
)
if pipette_id not in self._nozzle_manager_layout_by_id:
nozzle_manager = NozzleConfigurationManager.build_from_config(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
PipetteModelType,
PipetteChannelType,
PipetteVersionType,
PipetteOEMType,
)
from opentrons_shared_data.pipette.pipette_definition import (
PipetteConfigurations,
Expand Down Expand Up @@ -261,7 +262,10 @@ def test_single_pipettes_always_full(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.SINGLE_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.SINGLE_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config, ValidNozzleMaps(maps=A1)
Expand Down Expand Up @@ -289,7 +293,10 @@ def test_single_pipette_map_entries(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.SINGLE_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.SINGLE_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config, ValidNozzleMaps(maps=A1)
Expand Down Expand Up @@ -326,7 +333,10 @@ def test_single_pipette_map_geometry(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.SINGLE_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.SINGLE_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config, ValidNozzleMaps(maps=A1)
Expand Down Expand Up @@ -359,7 +369,10 @@ def test_multi_config_identification(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.EIGHT_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.EIGHT_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config,
Expand Down Expand Up @@ -419,7 +432,10 @@ def test_multi_config_map_entries(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.EIGHT_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.EIGHT_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config,
Expand Down Expand Up @@ -485,7 +501,10 @@ def test_multi_config_geometry(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.EIGHT_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.EIGHT_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config,
Expand Down Expand Up @@ -536,7 +555,10 @@ def test_96_config_identification(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.NINETY_SIX_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.NINETY_SIX_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config,
Expand Down Expand Up @@ -651,7 +673,10 @@ def test_96_config_map_entries(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.NINETY_SIX_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.NINETY_SIX_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config,
Expand Down Expand Up @@ -988,7 +1013,10 @@ def test_96_config_geometry(
pipette_details: Tuple[PipetteModelType, PipetteVersionType],
) -> None:
config = load_definition(
pipette_details[0], PipetteChannelType.NINETY_SIX_CHANNEL, pipette_details[1]
pipette_details[0],
PipetteChannelType.NINETY_SIX_CHANNEL,
pipette_details[1],
PipetteOEMType.OT,
)
subject = nozzle_manager.NozzleConfigurationManager.build_from_config(
config,
Expand Down
Loading

0 comments on commit 1973bbb

Please sign in to comment.