Skip to content

Commit

Permalink
find default new labware value if api level > 2.21
Browse files Browse the repository at this point in the history
  • Loading branch information
caila-marashaj committed Jan 9, 2025
1 parent 784c622 commit fa268d0
Showing 1 changed file with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,42 @@
"corning_24_wellplate_3.4ml_flat": 2,
}

_APILEVEL_2_21_OT_DEFAULT_VERSIONS: Dict[str, int] = {
"opentrons_10_tuberack_nest_4x50ml_6x15ml_conical": 2,
"opentrons_24_tuberack_nest_2ml_screwcap": 2,
"opentrons_24_tuberack_nest_1.5ml_screwcap": 2,
"nest_1_reservoir_290ml": 2,
"opentrons_24_tuberack_nest_2ml_snapcap": 2,
"nest_96_wellplate_2ml_deep": 3,
"opentrons_24_tuberack_nest_1.5ml_snapcap": 2,
"nest_12_reservoir_15ml": 2,
"nest_1_reservoir_195ml": 3,
"opentrons_24_tuberack_nest_0.5ml_screwcap": 2,
"opentrons_96_wellplate_200ul_pcr_full_skirt": 3,
"nest_96_wellplate_100ul_pcr_full_skirt": 3,
"nest_96_wellplate_200ul_flat": 3,
"opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical": 2,
"usascientific_12_reservoir_22ml": 2,
"thermoscientificnunc_96_wellplate_2000ul": 2,
"usascientific_96_wellplate_2.4ml_deep": 2,
"agilent_1_reservoir_290ml": 2,
"opentrons_24_tuberack_eppendorf_1.5ml_safelock_snapcap": 2,
"thermoscientificnunc_96_wellplate_1300ul": 2,
"corning_12_wellplate_6.9ml_flat": 3,
"corning_24_wellplate_3.4ml_flat": 3,
"corning_6_wellplate_16.8ml_flat": 3,
"corning_48_wellplate_1.6ml_flat": 3,
"biorad_96_wellplate_200ul_pcr": 3,
"axygen_1_reservoir_90ml": 2,
"corning_384_wellplate_112ul_flat": 3,
"corning_96_wellplate_360ul_flat": 3,
"biorad_384_wellplate_50ul": 3,
"appliedbiosystemsmicroamp_384_wellplate_40ul": 2,
"opentrons_24_tuberack_eppendorf_2ml_safelock_snapcap": 2,
"opentrons_10_tuberack_nest_4x50ml_6x15ml_conical": 2,
"opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical": 2,
}


class AmbiguousLoadLabwareParamsError(RuntimeError):
"""Error raised when specific labware parameters cannot be found due to multiple matching labware definitions."""
Expand Down Expand Up @@ -99,7 +135,13 @@ def matches_params(custom_params: LabwareLoadParams) -> bool:
return resolved_namespace, resolved_version


def _get_default_version_for_standard_labware(load_name: str) -> int:
def _get_default_version_for_standard_labware(
load_name: str, api_level: Tuple[int, int] = (2, 14)
) -> int:
# We know the protocol is running at least apiLevel 2.14 by this point because
# apiLevel 2.13 and below has its own separate code path for resolving labware.
if api_level >= (2, 21):
found_version = _APILEVEL_2_21_OT_DEFAULT_VERSIONS.get(load_name, None)
if found_version:
return found_version
return _APILEVEL_2_14_OT_DEFAULT_VERSIONS.get(load_name, 1)

0 comments on commit fa268d0

Please sign in to comment.