Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

breaking: space: Remove deprecated neighbor_Iter #1687

Merged
merged 1 commit into from
Jun 17, 2023
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
28 changes: 0 additions & 28 deletions mesa/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,21 +199,6 @@ def coord_iter(self) -> Iterator[tuple[GridContent, int, int]]:
for col in range(self.height):
yield self._grid[row][col], row, col # agent, x, y

def neighbor_iter(self, pos: Coordinate, moore: bool = True) -> Iterator[Agent]:
"""Iterate over position neighbors.

Args:
pos: (x,y) coords tuple for the position to get the neighbors of.
moore: Boolean for whether to use Moore neighborhood (including
diagonals) or Von Neumann (only up/down/left/right).
"""

warn(
"`neighbor_iter` is deprecated in favor of `iter_neighbors` "
"and will be removed in the subsequent version."
)
return self.iter_neighbors(pos, moore)

def iter_neighborhood(
self,
pos: Coordinate,
Expand Down Expand Up @@ -761,19 +746,6 @@ def get_neighborhood(

return neighborhood

def neighbor_iter(self, pos: Coordinate) -> Iterator[Agent]:
"""Iterate over position neighbors.

Args:
pos: (x,y) coords tuple for the position to get the neighbors of.
"""

warn(
"`neighbor_iter` is deprecated in favor of `iter_neighbors` "
"and will be removed in the subsequent version."
)
return self.iter_neighbors(pos)

def iter_neighborhood(
self, pos: Coordinate, include_center: bool = False, radius: int = 1
) -> Iterator[Coordinate]:
Expand Down