Skip to content

Commit

Permalink
Rh 21 use real adapters (#14141)
Browse files Browse the repository at this point in the history
* remove custom adapters

* use the new load_labware with adapters

* remove unneeded retracts now that it properly knows how to move and avoid adapters

* update LPC protocols to use real tiprack adapters

* format lint

* don't try and load the old custom def

* get lpc protocols passsing analaysis

* workaround a LPC bug (RAUT-897) with moving adapters

* format

* lint
  • Loading branch information
ryanthecoder committed Mar 13, 2024
1 parent b79517d commit 3f067b1
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 3,094 deletions.
3 changes: 0 additions & 3 deletions hardware-testing/hardware_testing/gravimetric/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ def _get_protocol_context(cls, args: argparse.Namespace) -> ProtocolContext:
labware_dir = Path(__file__).parent.parent / "labware"
custom_def_uris = [
"radwag_pipette_calibration_vial",
"opentrons_flex_96_tiprack_50ul_adp",
"opentrons_flex_96_tiprack_200ul_adp",
"opentrons_flex_96_tiprack_1000ul_adp",
]
for def_uri in custom_def_uris:
with open(labware_dir / def_uri / "1.json", "r") as f:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ def _record_measurement_and_store(m_type: MeasurementType) -> EnvironmentData:
if (i + 1) == num_dispenses:
if not trial.cfg.same_tip:
_drop_tip(trial.pipette, trial.cfg.return_tip)
trial.ctx._core.get_hardware().retract(OT3Mount.LEFT)
if not trial.ctx.is_simulating() and trial.channel_count == 96:
ui.get_user_ready("add SEAL to plate and remove from DECK")
return
Expand Down Expand Up @@ -347,8 +346,6 @@ def _find_liquid_height(
setup_tip = _next_tip(resources, cfg, cfg.pipette_channels == 1)
volume_for_setup = max(resources.test_volumes)
_pick_up_tip(resources.ctx, resources.pipette, cfg, location=setup_tip.top())
mnt = OT3Mount.LEFT if cfg.pipette_mount == "left" else OT3Mount.RIGHT
resources.ctx._core.get_hardware().retract(mnt)
if (
not resources.ctx.is_simulating()
and not cfg.same_tip
Expand Down Expand Up @@ -408,10 +405,8 @@ def _find_liquid_height(
raise RuntimeError(
f"bad volume in reservoir: {round(reservoir_ul / 1000, 1)} ml"
)
resources.ctx._core.get_hardware().retract(OT3Mount.LEFT)
if not cfg.same_tip:
resources.pipette.drop_tip(home_after=False) # always trash setup tips
resources.ctx._core.get_hardware().retract(OT3Mount.LEFT)
# NOTE: the first tip-rack should have already been replaced
# with new tips by the operator

Expand Down
17 changes: 10 additions & 7 deletions hardware-testing/hardware_testing/gravimetric/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,23 +414,22 @@ def _load_tipracks(
cfg: config.VolumetricConfig,
use_adapters: bool = False,
) -> List[Labware]:
adp_str = "_adp" if use_adapters else ""
tiprack_load_settings: List[Tuple[int, str]] = [
(
slot,
f"opentrons_flex_96_tiprack_{cfg.tip_volume}ul{adp_str}",
f"opentrons_flex_96_tiprack_{cfg.tip_volume}ul",
)
for slot in cfg.slots_tiprack
]
for ls in tiprack_load_settings:
ui.print_info(f'Loading tiprack "{ls[1]}" in slot #{ls[0]}')
if use_adapters:
tiprack_namespace = "custom_beta"
else:
tiprack_namespace = "opentrons"

adapter: Optional[str] = (
"opentrons_flex_96_tiprack_adapter" if use_adapters else None
)
# If running multiple tests in one run, the labware may already be loaded
loaded_labwares = ctx.loaded_labwares
print(f"Loaded labwares {loaded_labwares}")
pre_loaded_tips: List[Labware] = []
for ls in tiprack_load_settings:
if ls[0] in loaded_labwares.keys():
Expand All @@ -450,11 +449,15 @@ def _load_tipracks(
pick_up_offset=None,
drop_offset=None,
)
if ctx.deck[ls[0]] is not None:
# remove the adapter from the slot too
ui.print_info(f"removing {ctx.deck[ls[0]]} from slot {ls[0]}")
del ctx.deck[ls[0]]
if len(pre_loaded_tips) == len(tiprack_load_settings):
return pre_loaded_tips

tipracks = [
ctx.load_labware(ls[1], location=ls[0], namespace=tiprack_namespace)
ctx.load_labware(ls[1], location=ls[0], adapter=adapter)
for ls in tiprack_load_settings
]
return tipracks
Expand Down
Loading

0 comments on commit 3f067b1

Please sign in to comment.