Skip to content

Commit

Permalink
measure evaporation from previous trial so that liquid-tracker can up…
Browse files Browse the repository at this point in the history
…date using it's aspirate method
  • Loading branch information
andySigler committed Jul 6, 2023
1 parent 9291903 commit 6131567
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions hardware-testing/hardware_testing/gravimetric/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

_MEASUREMENTS: List[Tuple[str, MeasurementData]] = list()

_STARTING_GRAMS: Optional[MeasurementData] = None
_PREV_TRIAL_GRAMS: Optional[MeasurementData] = None


def _generate_callbacks_for_trial(
Expand Down Expand Up @@ -329,7 +329,7 @@ def _run_trial(
scale_delay: int = DELAY_FOR_MEASUREMENT,
measure_height: float = 50,
) -> Tuple[float, MeasurementData, float, MeasurementData]:
global _STARTING_GRAMS
global _PREV_TRIAL_GRAMS
pipetting_callbacks = _generate_callbacks_for_trial(
recorder, volume, channel, trial, blank
)
Expand Down Expand Up @@ -369,16 +369,15 @@ def _record_measurement_and_store(m_type: MeasurementType) -> MeasurementData:
pipette.move_to(well.top(measure_height).move(channel_offset))
m_data_init = _record_measurement_and_store(MeasurementType.INIT)
print(f"\tinitial grams: {m_data_init.grams_average} g")
if _STARTING_GRAMS is None:
_STARTING_GRAMS = m_data_init
else:
if _PREV_TRIAL_GRAMS is not None:
_evaporation_loss_ul = abs(
calculate_change_in_volume(_STARTING_GRAMS, m_data_init)
calculate_change_in_volume(_PREV_TRIAL_GRAMS, m_data_init)
)
print(f"calculated {_evaporation_loss_ul} ul has evaporated during the test")
print(f"{_evaporation_loss_ul} ul evaporated since last trial")
liquid_tracker.update_affected_wells(
well, aspirate=_evaporation_loss_ul, channels=1
)
_PREV_TRIAL_GRAMS = m_data_init

# RUN ASPIRATE
aspirate_with_liquid_class(
Expand Down

0 comments on commit 6131567

Please sign in to comment.