Skip to content

Commit

Permalink
configuring for volume simulates
Browse files Browse the repository at this point in the history
  • Loading branch information
andySigler committed Feb 4, 2025
1 parent 3d6db75 commit f37ad5d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions hardware-testing/hardware_testing/gravimetric/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ def _run_trial(
lc_name = SupportedLiquid.from_string(trial.cfg.liquid).name_with_dilution(
trial.cfg.dilution
)
liquid_class_root = trial.ctx.define_liquid_class(lc_name.lower().replace("-", "_"))
liquid_class_root = trial.ctx.define_liquid_class(
lc_name.lower().replace("-", "_")
)
pip_load_name = (
f"flex_{trial.pipette.channels}channel_{int(trial.pipette.max_volume)}"
)
Expand Down Expand Up @@ -402,19 +404,22 @@ def _record_measurement_and_store(m_type: MeasurementType) -> MeasurementData:
# so for now we are still using the custom liquid-height code here, and
# tell the API's liquid-class to move the correct submerge depth (relative to well-bottom)
def _calculate_meniscus_relative_offsets(is_aspirate: bool) -> None:
_attr_name = "aspirate" if is_aspirate else "dispense"
_asp_or_disp = getattr(liquid_class, _attr_name)
_retract_mm = max(
0.0, _asp_or_disp.submerge.offset.z, _asp_or_disp.retract.offset.z
)
approach, submerge, retract = _get_approach_submerge_retract_heights(
trial.well,
trial.liquid_tracker,
submerge_mm=-1.5, # FIXME: use variable
retract_mm=3.0, # FIXME: use variable
submerge_mm=-1.5, # NOTE: this will continue to be set here in script until LLD is available
retract_mm=_retract_mm, # FIXME: use value from liquid-class definition
mix=None,
aspirate=trial.volume if is_aspirate else None,
dispense=trial.volume if not is_aspirate else None,
blank=trial.blank,
channel_count=trial.channel_count,
)
_attr_name = "aspirate" if is_aspirate else "dispense"
_asp_or_disp = getattr(liquid_class, _attr_name)
# NOTE: setting all position references to BOTTOM
_asp_or_disp.submerge.position_reference = PositionReference.WELL_BOTTOM
_asp_or_disp.position_reference = PositionReference.WELL_BOTTOM
Expand Down Expand Up @@ -445,16 +450,19 @@ def _calculate_meniscus_relative_offsets(is_aspirate: bool) -> None:
else:
# FIXME: this should happen inside the `transfer_liquid` command
# so delete this `configure` call once that is added
# NOTE: required to remove air-gap before calling configure-for-volume
trial.pipette.dispense(trial.pipette.current_volume, push_out=0)
trial.pipette.prepare_to_aspirate()
if trial.mode == "default":
trial.pipette.configure_for_volume(volume=trial.pipette.max_volume)
elif trial.mode == "lowVolumeDefault":
assert trial.pipette.max_volume == 50
trial.pipette.configure_for_volume(volume=trial.pipette.min_volume)
else:
trial.pipette.configure_for_volume(volume=trial.volume)
_calculate_meniscus_relative_offsets(is_aspirate=True)
# FIXME: This assumes whatever is in the pipette from last trial is air (not liquid),
# and so this would break any sort of multi-dispense testing
_calculate_meniscus_relative_offsets(is_aspirate=True)
assumed_air_gap = trial.pipette.current_volume
tip_contents = trial.pipette._core.aspirate_liquid_class(
volume=trial.volume,
Expand Down

0 comments on commit f37ad5d

Please sign in to comment.