Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 33 additions & 6 deletions solvers/python/src/aoc/tooling/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,45 @@ def iter_data_by_columns(

@overload
def iter_data(
self, *, direction: IterDirection
self, *, direction: Literal[IterDirection.Rows] = IterDirection.Rows
) -> Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]: ...
@overload
def iter_data(
self, *, direction: Literal[IterDirection.Columns]
) -> Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]: ...
@overload
def iter_data(
self, *, direction: Literal[IterDirection.Rows] = IterDirection.Rows
self, *, direction: IterDirection
) -> (
Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]
| Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]
): ...
@overload
def iter_data(
self,
first_y: Y,
first_x: X,
*,
direction: Literal[IterDirection.Rows] = IterDirection.Rows,
) -> Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]: ...
@overload
def iter_data(
self, first_y: Y, first_x: X, *, direction: IterDirection
self, first_y: Y, first_x: X, *, direction: Literal[IterDirection.Columns]
) -> Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]: ...
@overload
def iter_data(
self, first_y: Y, first_x: X, *, direction: IterDirection
) -> (
Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]
| Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]
): ...
@overload
def iter_data(
self,
first_y: Y,
first_x: X,
last_y: Y,
last_x: X,
*,
direction: Literal[IterDirection.Rows] = IterDirection.Rows,
) -> Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]: ...
Expand All @@ -189,7 +213,7 @@ def iter_data(
last_y: Y,
last_x: X,
*,
direction: IterDirection,
direction: Literal[IterDirection.Columns],
) -> Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]: ...
@overload
def iter_data(
Expand All @@ -199,8 +223,11 @@ def iter_data(
last_y: Y,
last_x: X,
*,
direction: Literal[IterDirection.Rows] = IterDirection.Rows,
) -> Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]: ...
direction: IterDirection,
) -> (
Iterable[tuple[Y, Iterable[tuple[X, Map2dDataType]]]]
| Iterable[tuple[X, Iterable[tuple[Y, Map2dDataType]]]]
): ...

def iter_data(
self,
Expand Down
Loading