ExplicitMapper
Map items by explicit index pairs or sequential index order.
When no pairs are specified, maps by index: start[0]βend[0], start[1]βend[1], etc. Extra items on either side become creations or destructions. When pairs are specified, maps exactly as given. Unmentioned items become creations or destructions.
Constructor
ExplicitMapper(pairs: Optional[Sequence[Tuple[int, int]]] = None)
Parameters
-
pairs - Optional list of (start_index, end_index) tuples. If None, maps sequentially by index.
Methods
map
map(
start_items: List[T],
end_items: List[T],
get_position: Callable[[T], Point2D]
) -> List[Match[T]]
Map items by index order or explicit pairs.