Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def default_blowout(self, volume):
if self._is_single_channel():
if volume < Unit("10:ul"):
blowout_vol = Unit("5:ul")
elif volume < Unit("25:ul"):
blowout_vol = Unit("10:ul")
elif volume < Unit("75:ul"):
blowout_vol = Unit("15:ul")
elif volume < Unit("100:ul"):
blowout_vol = Unit("20:ul")
else:
blowout_vol = Unit("25:ul")
else:
blowout_vol = Unit("5:ul")
return LiquidHandle.builders.blowout(
volume=blowout_vol,
initial_z=self.default_well_top_position_z(),
flowrate=None,
)
default_aspirate_z : specifies default aspirate_z parameters
prime : holds any user defined prime volume
default_prime : specifies default prime volume
_aspirate_simple : lower level helper that generates aspirate transports
_aspirate_with_prime : lower level helper for aspirating with priming
"""
aspirate_z = self.aspirate_z or self.default_aspirate_z(volume)
if self.prime is True:
prime = self.default_prime(volume)
elif self.prime is False:
prime = False
else:
prime = self.prime
aspirate_z = LiquidHandle.builders.position_z(**aspirate_z)
if prime is not False:
prime = parse_unit(prime, "uL")
self._aspirate_with_prime(
volume=volume,
prime_vol=prime,
calibrated_vol=self._source_liquid._get_calibrated_volume(
volume, self.tip_type
),
initial_z=aspirate_z,
asp_flowrate=self._source_liquid._get_aspirate_flowrate(
volume, self.tip_type
),
dsp_flowrate=self._source_liquid._get_dispense_flowrate(
volume, self.tip_type
),
delay_time=self._source_liquid.delay_time,
Parameters
----------
position_z : dict
position to be referenced when deciding on a followup position
Returns
-------
dict
position_z to follow up at a non-sensing position
"""
preceding_z = LiquidHandle.builders.position_z(reference="preceding_position")
if not position_z:
followup_z = preceding_z
elif position_z["reference"] == "liquid_surface":
followup_z = LiquidHandle.builders.position_z(
reference="liquid_surface",
offset=position_z.get("offset"),
detection_method="tracked",
)
else:
followup_z = preceding_z
return followup_z
def _move_to_well_top_before_lld(self, position_z):
"""If position_z contains any liquid sensing moves to well top
Parameters
----------
position_z : dict
position_z to be checked for lld events
"""
well_top_z = LiquidHandle.builders.transport(
mode_params=LiquidHandle.builders.mode_params(
position_z=LiquidHandle.builders.position_z(reference="well_top")
)
)
if position_z:
if position_z.get("reference") == "liquid_surface":
if position_z.get("detection", {}).get("method") != "tracked":
self._transports.append(well_top_z)
if mix repetitions is not an int
See Also
--------
repetitions : holds any user defined repetition parameters
default_repetitions : specifies default repetition parameters
position_z : holds any user defined position_z parameters
default_position_z : specifies default position_z parameters
_mix : lower level helper that generates the mix transports
"""
repetitions = self.repetitions or self.default_repetitions(volume)
position_z = self.position_z or self.default_position_z(volume)
if not isinstance(repetitions, int):
raise TypeError(f"Mix repetitions {repetitions} was not an int.")
position_z = LiquidHandle.builders.position_z(**position_z)
self._mix(
volume=volume,
repetitions=repetitions,
initial_z=position_z,
asp_flowrate=self._liquid._get_aspirate_flowrate(volume, self.tip_type),
dsp_flowrate=self._liquid._get_dispense_flowrate(volume, self.tip_type),
delay_time=self._liquid.delay_time,
liquid_class=self._liquid.name,
)
position that the tip will move to before pump movement
calibrated_vol : Unit, optional
calibrated volume, volume which the pump will move
flowrate : dict, optional
flowrate of liquid during aspiration
delay_time : Unit, optional
time to pause after aspirating to let pressure equilibrate
liquid_class : str, optional
the name of the liquid class being aspirated
density : Unit, optional
the density of liquid being aspirated
"""
followup_z = self._move_to_initial_position(position_x, position_y, initial_z)
mode_params = LiquidHandle.builders.mode_params(
position_x=position_x,
position_y=position_y,
position_z=followup_z,
liquid_class=liquid_class,
)
self._transports += [
LiquidHandle.builders.transport(
volume=-volume,
density=density,
# pylint: disable=invalid-unary-operand-type
pump_override_volume=-calibrated_vol if calibrated_vol else None,
flowrate=flowrate,
mode_params=mode_params,
delay_time=delay_time,
)
density : Unit, optional
the density of liquid being aspirated
"""
followup_z = self._move_to_initial_position(position_x, position_y, initial_z)
mode_params = LiquidHandle.builders.mode_params(
position_x=position_x,
position_y=position_y,
position_z=followup_z,
liquid_class=liquid_class,
)
# Aspirate with priming volume
self._transports += [
LiquidHandle.builders.transport(
volume=-prime_vol,
density=density,
pump_override_volume=-prime_vol,
flowrate=asp_flowrate,
mode_params=mode_params,
delay_time=delay_time,
),
LiquidHandle.builders.transport(
volume=-volume,
density=density,
# pylint: disable=invalid-unary-operand-type
pump_override_volume=(-calibrated_vol if calibrated_vol else None),
flowrate=asp_flowrate,
mode_params=mode_params,
delay_time=delay_time,
),