pylabrobot.lib.liquid_handling.pipette_batch_scheduling.plan_batches#

pylabrobot.lib.liquid_handling.pipette_batch_scheduling.plan_batches(use_channels: List[int], containers: List[Container], channel_spacings: List[float], wrt_resource: Resource, x_tolerance: float, resource_offsets: List[Coordinate] | None = None) → List[ChannelBatch]#

Container-aware, optimal batch planning (respects no-go zones).

Decides the per-container spread per candidate batch by asking compute_nonconsecutive_channel_offsets() whether the channels targeting each container physically coexist in it given its geometry and no-go zones. Pairs that behavior with minimum exact-cover partition (minimum_exact_cover()) so the returned plan uses the fewest batches.

Parameters:
  • use_channels (List[int]) – Channel indices being used (parallel to containers).

  • containers (List[Container]) – Target Container objects, one per channel.

  • channel_spacings (List[float]) – Per-channel minimum Y spacing (mm).

  • wrt_resource (Resource) – Reference resource for computing absolute positions.

  • x_tolerance (float) – Positions within this tolerance share a batch (pairwise).

  • resource_offsets (List[Coordinate] | None) – Optional explicit XYZ offsets from container centers. When provided, auto-spread and no-go-zone checks are skipped (user is authoritative).

Returns:

Flat list of ChannelBatch sorted by ascending X position.

Return type:

List[ChannelBatch]