pylabrobot.lib.liquid_handling.pipette_batch_scheduling.is_valid_batch#
- pylabrobot.lib.liquid_handling.pipette_batch_scheduling.is_valid_batch(job_indices: Collection[int], use_channels: List[int], containers: List[Container], channel_spacings: List[float], wrt_resource: Resource, x_tolerance: float, resource_offsets: List[Coordinate] | None = None) Dict[int, Coordinate] | None#
Validate a candidate batch against all physical constraints, cheapest first.
- Checks, in order:
Unique channels — O(k), prunes most candidates instantly.
Same X — O(k), uses container centers (X isn’t shifted by auto-spread).
Container fit — per container, calls
compute_nonconsecutive_channel_offsets()to see if the channels targeting it can coexist (respecting no-go zones). Skipped when resource_offsets is provided. This is the expensive check.Y spacing between adjacent channels — O(k) on resolved positions.
- Returns:
Dict mapping each job index to its resolved absolute Coordinate if the batch is valid;
Noneotherwise.- Parameters:
- Return type:
Dict[int, Coordinate] | None