Skip to content

Commit

Permalink
Fix return type
Browse files Browse the repository at this point in the history
  • Loading branch information
Corvince committed Feb 5, 2021
1 parent 49db41c commit 6af18a9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mesa/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def iter_neighbors(
An iterator of non-None objects in the given neighborhood;
at most 9 if Moore, 5 if Von-Neumann
(8 and 4 if not including the center).
g
"""
neighborhood = self.get_neighborhood(pos, moore, include_center, radius)
return self.iter_cell_list_contents(neighborhood)
Expand All @@ -258,8 +258,8 @@ def get_neighbors(
moore: bool,
include_center: bool = False,
radius: int = 1,
) -> List[Coordinate]:
"""Return a list of neighbors to a certain point.
) -> List[GridContent]:
""" Return a list of neighbors to a certain point.
Args:
pos: Coordinate tuple for the neighborhood to get.
Expand Down Expand Up @@ -287,8 +287,7 @@ def torus_adj(self, pos: Coordinate) -> Coordinate:
elif not self.torus:
raise Exception("Point out of bounds, and space non-toroidal.")
else:
x, y = pos[0] % self.width, pos[1] % self.height
return x, y
return pos[0] % self.width, pos[1] % self.height

def out_of_bounds(self, pos: Coordinate) -> bool:
"""
Expand Down

0 comments on commit 6af18a9

Please sign in to comment.