@@ -2587,45 +2587,44 @@ def divide_list_into_chunks(
2587
2587
2588
2588
# Only continue if tip_racks are not already consolidated
2589
2589
if len (target_tip_clusters_by_parent_x ) > 0 :
2590
- current_tip_model = all_origin_tip_spots [0 ].tracker .get_tip ()
2591
-
2592
- # Ensure there are channels that can pick up the tip model
2593
- num_channels_available = len (
2594
- [
2595
- c
2596
- for c in range (self .backend .num_channels )
2597
- if self .backend .can_pick_up_tip (c , current_tip_model )
2598
- ]
2599
- )
2590
+ raise ValueError (f"No channel capable of handling tips on deck: { current_tip_model } " )
2600
2591
2601
- # 5: Optimise speed
2602
- if num_channels_available > 0 :
2603
- # by aggregating drop columns i.e. same drop column should not be visited twice!
2604
- if num_channels_available >= 8 : # physical constraint of tip_rack's having 8 rows
2605
- merged_target_tip_clusters = merge_sublists (
2606
- target_tip_clusters_by_parent_x .values (), max_len = 8
2607
- )
2592
+ current_tip_model = all_origin_tip_spots [0 ].tracker .get_tip ()
2608
2593
2609
- else : # by chunking drop tip_spots list into size of available channels
2610
- merged_target_tip_clusters = list (
2611
- divide_list_into_chunks (all_target_tip_spots , chunk_size = num_channels_available )
2612
- )
2594
+ # Ensure there are channels that can pick up the tip model
2595
+ num_channels_available = len (
2596
+ [
2597
+ c
2598
+ for c in range (self .backend .num_channels )
2599
+ if self .backend .can_pick_up_tip (c , current_tip_model )
2600
+ ]
2601
+ )
2613
2602
2614
- len_transfers = len (merged_target_tip_clusters )
2603
+ # 5: Optimise speed
2604
+ if num_channels_available > 0 :
2605
+ # by aggregating drop columns i.e. same drop column should not be visited twice!
2606
+ if num_channels_available >= 8 : # physical constraint of tip_rack's having 8 rows
2607
+ merged_target_tip_clusters = merge_sublists (
2608
+ target_tip_clusters_by_parent_x .values (), max_len = 8
2609
+ )
2615
2610
2616
- # 6: Execute tip movement/consolidation
2617
- for idx , target_tip_spots in enumerate (merged_target_tip_clusters ):
2618
- print (f" - tip transfer cycle: { idx } / { len_transfers - 1 } " )
2619
- num_channels = len (target_tip_spots )
2620
- use_channels = list (range (num_channels ))
2611
+ else : # by chunking drop tip_spots list into size of available channels
2612
+ merged_target_tip_clusters = list (
2613
+ divide_list_into_chunks (all_target_tip_spots , chunk_size = num_channels_available )
2614
+ )
2621
2615
2622
- origin_tip_spots = [ all_origin_tip_spots . pop ( 0 ) for idx in range ( num_channels )]
2616
+ len_transfers = len ( merged_target_tip_clusters )
2623
2617
2624
- await self .pick_up_tips (origin_tip_spots , use_channels = use_channels )
2618
+ # 6: Execute tip movement/consolidation
2619
+ for idx , target_tip_spots in enumerate (merged_target_tip_clusters ):
2620
+ print (f" - tip transfer cycle: { idx } / { len_transfers - 1 } " )
2621
+ num_channels = len (target_tip_spots )
2622
+ use_channels = list (range (num_channels ))
2625
2623
2626
- await self .drop_tips (target_tip_spots , use_channels = use_channels )
2627
- else :
2628
- print ("Tips already optimally consolidated!" )
2624
+ origin_tip_spots = [all_origin_tip_spots .pop (0 ) for idx in range (num_channels )]
2629
2625
2626
+ await self .pick_up_tips (origin_tip_spots , use_channels = use_channels )
2627
+
2628
+ await self .drop_tips (target_tip_spots , use_channels = use_channels )
2630
2629
else :
2631
- raise ValueError ( f"No channel capable of handling tips on deck: { current_tip_model } " )
2630
+ print ( "Tips already optimally consolidated! " )
0 commit comments