pylabrobot.lib.liquid_handling.tip_consolidation.plan_tip_consolidation#

pylabrobot.lib.liquid_handling.tip_consolidation.plan_tip_consolidation(tip_racks: List[TipRack], num_channels: int, can_pick_up_tip: Callable[[int, Tip], bool], use_channels: List[int] | None = None) → List[TipTransferBatch]#

Plan consolidation of partially filled racks, grouped by tip model.

Full and empty racks are ignored. Within each model, racks are filled in order of increasing empty spots, preserving input order for ties. With eight or more available channels, destination columns are kept together where possible and batches contain at most eight tips. Smaller channel selections use consecutive chunks of destination spots.

Parameters:
  • tip_racks (List[TipRack]) – Racks whose tracked tip inventory should be consolidated.

  • num_channels (int) – Number of channels on the device.

  • can_pick_up_tip (Callable[[int, Tip], bool]) – Predicate accepting a channel index and a tip. Used to select compatible channels separately for each model when use_channels is omitted.

  • use_channels (List[int] | None) – Explicit channel selection, in execution order. The caller is responsible for ensuring these channels can handle the tips.

Returns:

Ordered pickup/drop batches. Planning does not mutate resources. Execute the plan before making other changes to the supplied racks’ tip inventory.

Raises:

ValueError – If a partial rack has undefined or mixed tip models, an explicit channel selection is invalid, or no channel can handle a required transfer.

Return type:

List[TipTransferBatch]