@@ -1689,6 +1689,94 @@ def distribute_liquid(
1689
1689
)
1690
1690
return self
1691
1691
1692
+ def consolidate_liquid (
1693
+ self ,
1694
+ liquid_class : LiquidClass ,
1695
+ volume : float ,
1696
+ source : Union [
1697
+ labware .Well , Sequence [labware .Well ], Sequence [Sequence [labware .Well ]]
1698
+ ],
1699
+ dest : labware .Well ,
1700
+ new_tip : TransferTipPolicyV2Type = "once" ,
1701
+ trash_location : Optional [
1702
+ Union [types .Location , labware .Well , TrashBin , WasteChute ]
1703
+ ] = None ,
1704
+ ) -> InstrumentContext :
1705
+ """
1706
+ Consolidate liquid from multiple sources to a single destination
1707
+ using the specified liquid class properties.
1708
+
1709
+ TODO: Add args description.
1710
+ """
1711
+ if not feature_flags .allow_liquid_classes (
1712
+ robot_type = RobotTypeEnum .robot_literal_to_enum (
1713
+ self ._protocol_core .robot_type
1714
+ )
1715
+ ):
1716
+ raise NotImplementedError ("This method is not implemented." )
1717
+ if not isinstance (dest , labware .Well ):
1718
+ raise ValueError (
1719
+ f"Destination should be a single Well but received { dest } ."
1720
+ )
1721
+ flat_sources_list = validation .ensure_valid_flat_wells_list_for_transfer_v2 (
1722
+ source
1723
+ )
1724
+ for well in flat_sources_list + [dest ]:
1725
+ instrument .validate_takes_liquid (
1726
+ location = well .top (),
1727
+ reject_module = True ,
1728
+ reject_adapter = True ,
1729
+ )
1730
+
1731
+ valid_new_tip = validation .ensure_new_tip_policy (new_tip )
1732
+ if valid_new_tip == TransferTipPolicyV2 .NEVER :
1733
+ if self ._last_tip_picked_up_from is None :
1734
+ raise RuntimeError (
1735
+ "Pipette has no tip attached to perform transfer."
1736
+ " Either do a pick_up_tip beforehand or specify a new_tip parameter"
1737
+ " of 'once' or 'always'."
1738
+ )
1739
+ else :
1740
+ tip_racks = [self ._last_tip_picked_up_from .parent ]
1741
+ else :
1742
+ tip_racks = self ._tip_racks
1743
+ if self .current_volume != 0 :
1744
+ raise RuntimeError (
1745
+ "A transfer on a liquid class cannot start with liquid already in the tip."
1746
+ " Ensure that all previously aspirated liquid is dispensed before starting"
1747
+ " a new transfer."
1748
+ )
1749
+
1750
+ _trash_location : Union [types .Location , labware .Well , TrashBin , WasteChute ]
1751
+ if trash_location is None :
1752
+ saved_trash = self .trash_container
1753
+ if isinstance (saved_trash , labware .Labware ):
1754
+ _trash_location = saved_trash .wells ()[0 ]
1755
+ else :
1756
+ _trash_location = saved_trash
1757
+ else :
1758
+ _trash_location = trash_location
1759
+
1760
+ checked_trash_location = validation .ensure_valid_trash_location_for_transfer_v2 (
1761
+ trash_location = _trash_location
1762
+ )
1763
+ self ._core .consolidate_liquid (
1764
+ liquid_class = liquid_class ,
1765
+ volume = volume ,
1766
+ source = [
1767
+ (types .Location (types .Point (), labware = well ), well ._core )
1768
+ for well in flat_sources_list
1769
+ ],
1770
+ dest = (types .Location (types .Point (), labware = dest ), dest ._core ),
1771
+ new_tip = valid_new_tip ,
1772
+ tip_racks = [
1773
+ (types .Location (types .Point (), labware = rack ), rack ._core )
1774
+ for rack in tip_racks
1775
+ ],
1776
+ trash_location = checked_trash_location ,
1777
+ )
1778
+ return self
1779
+
1692
1780
@requires_version (2 , 0 )
1693
1781
def delay (self , * args : Any , ** kwargs : Any ) -> None :
1694
1782
"""
0 commit comments