@@ -1712,6 +1712,11 @@ async def aspirate(
17121712 and 360. Defaults to well bottom + liquid height. Should use absolute z.
17131713 """
17141714
1715+ if mix_volume is not None or mix_cycles is not None or mix_speed is not None :
1716+ raise NotImplementedError (
1717+ "Mixing through backend kwargs is deprecated. Use the `mix` parameter of LiquidHandler.aspirate instead."
1718+ )
1719+
17151720 x_positions , y_positions , channels_involved = self ._ops_to_fw_positions (ops , use_channels )
17161721
17171722 n = len (ops )
@@ -1817,17 +1822,12 @@ async def aspirate(
18171822 hlc .aspiration_settling_time if hlc is not None else 0.0 for hlc in hamilton_liquid_classes
18181823 ],
18191824 )
1820- mix_volume = _fill_in_defaults ( mix_volume , [ 0.0 ] * n )
1821- mix_cycles = _fill_in_defaults ( mix_cycles , [ 0 ] * n )
1825+ mix_volume = [ op . mix . volume if op . mix is not None else 0.0 for op in ops ]
1826+ mix_cycles = [ op . mix . repetitions if op . mix is not None else 0 for op in ops ]
18221827 mix_position_from_liquid_surface = _fill_in_defaults (
18231828 mix_position_from_liquid_surface , [0.0 ] * n
18241829 )
1825- mix_speed = _fill_in_defaults (
1826- mix_speed ,
1827- default = [
1828- hlc .aspiration_mix_flow_rate if hlc is not None else 50.0 for hlc in hamilton_liquid_classes
1829- ],
1830- )
1830+ mix_speed = [op .mix .flow_rate if op .mix is not None else 100.0 for op in ops ]
18311831 mix_surface_following_distance = _fill_in_defaults (mix_surface_following_distance , [0.0 ] * n )
18321832 limit_curve_index = _fill_in_defaults (limit_curve_index , [0 ] * n )
18331833
@@ -2007,6 +2007,11 @@ async def dispense(
20072007 documentation. Dispense mode 4.
20082008 """
20092009
2010+ if mix_volume is not None or mix_cycles is not None or mix_speed is not None :
2011+ raise NotImplementedError (
2012+ "Mixing through backend kwargs is deprecated. Use the `mix` parameter of LiquidHandler.dispense instead."
2013+ )
2014+
20102015 x_positions , y_positions , channels_involved = self ._ops_to_fw_positions (ops , use_channels )
20112016
20122017 n = len (ops )
@@ -2113,17 +2118,12 @@ async def dispense(
21132118 hlc .dispense_settling_time if hlc is not None else 0.0 for hlc in hamilton_liquid_classes
21142119 ],
21152120 )
2116- mix_volume = _fill_in_defaults ( mix_volume , [ 0.0 ] * n )
2117- mix_cycles = _fill_in_defaults ( mix_cycles , [ 0 ] * n )
2121+ mix_volume = [ op . mix . volume if op . mix is not None else 0.0 for op in ops ]
2122+ mix_cycles = [ op . mix . repetitions if op . mix is not None else 0 for op in ops ]
21182123 mix_position_from_liquid_surface = _fill_in_defaults (
21192124 mix_position_from_liquid_surface , [0.0 ] * n
21202125 )
2121- mix_speed = _fill_in_defaults (
2122- mix_speed ,
2123- default = [
2124- hlc .dispense_mix_flow_rate if hlc is not None else 50.0 for hlc in hamilton_liquid_classes
2125- ],
2126- )
2126+ mix_speed = [op .mix .flow_rate if op .mix is not None else 1.0 for op in ops ]
21272127 mix_surface_following_distance = _fill_in_defaults (mix_surface_following_distance , [0.0 ] * n )
21282128 limit_curve_index = _fill_in_defaults (limit_curve_index , [0 ] * n )
21292129
@@ -2281,7 +2281,7 @@ async def aspirate96(
22812281 mix_cycles : int = 0 ,
22822282 mix_position_from_liquid_surface : float = 0 ,
22832283 surface_following_distance_during_mix : float = 0 ,
2284- speed_of_mix : float = 120 .0 ,
2284+ speed_of_mix : float = 0 .0 ,
22852285 limit_curve_index : int = 0 ,
22862286 ):
22872287 """Aspirate using the Core96 head.
@@ -2327,6 +2327,11 @@ async def aspirate96(
23272327 limit_curve_index: The index of the limit curve to use.
23282328 """
23292329
2330+ if mix_volume != 0 or mix_cycles != 0 or speed_of_mix != 0 :
2331+ raise NotImplementedError (
2332+ "Mixing through backend kwargs is deprecated. Use the `mix` parameter of LiquidHandler.aspirate96 instead."
2333+ )
2334+
23302335 assert self .core96_head_installed , "96 head must be installed"
23312336
23322337 # get the first well and tip as representatives
@@ -2395,7 +2400,6 @@ async def aspirate96(
23952400 flow_rate = aspiration .flow_rate or (hlc .aspiration_flow_rate if hlc is not None else 250 )
23962401 swap_speed = swap_speed or (hlc .aspiration_swap_speed if hlc is not None else 100 )
23972402 settling_time = settling_time or (hlc .aspiration_settling_time if hlc is not None else 0.5 )
2398- speed_of_mix = speed_of_mix or (hlc .aspiration_mix_flow_rate if hlc is not None else 10.0 )
23992403
24002404 channel_pattern = [True ] * 12 * 8
24012405
@@ -2444,11 +2448,11 @@ async def aspirate96(
24442448 gamma_lld_sensitivity = gamma_lld_sensitivity ,
24452449 swap_speed = round (swap_speed * 10 ),
24462450 settling_time = round (settling_time * 10 ),
2447- mix_volume = round (mix_volume * 10 ),
2448- mix_cycles = mix_cycles ,
2451+ mix_volume = round (aspiration . mix . volume * 10 ) if aspiration . mix is not None else 0 ,
2452+ mix_cycles = aspiration . mix . repetitions if aspiration . mix is not None else 0 ,
24492453 mix_position_from_liquid_surface = round (mix_position_from_liquid_surface * 10 ),
24502454 surface_following_distance_during_mix = round (surface_following_distance_during_mix * 10 ),
2451- speed_of_mix = round (speed_of_mix * 10 ),
2455+ speed_of_mix = round (aspiration . mix . flow_rate * 10 ) if aspiration . mix is not None else 1200 ,
24522456 channel_pattern = channel_pattern ,
24532457 limit_curve_index = limit_curve_index ,
24542458 tadm_algorithm = False ,
@@ -2482,7 +2486,7 @@ async def dispense96(
24822486 mixing_cycles : int = 0 ,
24832487 mixing_position_from_liquid_surface : float = 0 ,
24842488 surface_following_distance_during_mixing : float = 0 ,
2485- speed_of_mixing : float = 120 .0 ,
2489+ speed_of_mixing : float = 0 .0 ,
24862490 limit_curve_index : int = 0 ,
24872491 cut_off_speed : float = 5.0 ,
24882492 stop_back_volume : float = 0 ,
@@ -2523,6 +2527,11 @@ async def dispense96(
25232527 stop_back_volume: Unknown.
25242528 """
25252529
2530+ if mixing_volume != 0 or mixing_cycles != 0 or speed_of_mixing != 0 :
2531+ raise NotImplementedError (
2532+ "Mixing through backend kwargs is deprecated. Use the `mix` parameter of LiquidHandler.dispense instead."
2533+ )
2534+
25262535 assert self .core96_head_installed , "96 head must be installed"
25272536
25282537 # get the first well and tip as representatives
@@ -2593,7 +2602,6 @@ async def dispense96(
25932602 flow_rate = dispense .flow_rate or (hlc .dispense_flow_rate if hlc is not None else 120 )
25942603 swap_speed = swap_speed or (hlc .dispense_swap_speed if hlc is not None else 100 )
25952604 settling_time = settling_time or (hlc .dispense_settling_time if hlc is not None else 5 )
2596- speed_of_mixing = speed_of_mixing or (hlc .dispense_mix_flow_rate if hlc is not None else 100 )
25972605
25982606 channel_pattern = [True ] * 12 * 8
25992607
@@ -2628,11 +2636,11 @@ async def dispense96(
26282636 gamma_lld_sensitivity = gamma_lld_sensitivity ,
26292637 swap_speed = round (swap_speed * 10 ),
26302638 settling_time = round (settling_time * 10 ),
2631- mixing_volume = round (mixing_volume * 10 ),
2632- mixing_cycles = mixing_cycles ,
2639+ mixing_volume = round (dispense . mix . volume * 10 ) if dispense . mix is not None else 0 ,
2640+ mixing_cycles = dispense . mix . repetitions if dispense . mix is not None else 0 ,
26332641 mixing_position_from_liquid_surface = round (mixing_position_from_liquid_surface * 10 ),
26342642 surface_following_distance_during_mixing = round (surface_following_distance_during_mixing * 10 ),
2635- speed_of_mixing = round (speed_of_mixing * 10 ),
2643+ speed_of_mixing = round (dispense . mix . flow_rate * 10 ) if dispense . mix is not None else 1200 ,
26362644 channel_pattern = channel_pattern ,
26372645 limit_curve_index = limit_curve_index ,
26382646 tadm_algorithm = False ,
0 commit comments