Skip to content

Commit 2bedc07

Browse files
committed
space: Improve typing for NetworkGrid
1 parent 01cb1dc commit 2bedc07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mesa/space.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,7 +1559,7 @@ class NetworkGrid:
15591559
"""Returns a bool of the contents of a cell."""
15601560
return self.G.nodes[node_id]["agent"] == self.default_val()
15611561
1562-
def get_cell_list_contents(self, cell_list: list[int]) -> list[Agent]:
1562+
def get_cell_list_contents(self, cell_list: list[int] | nx.Graph) -> list[Agent]:
15631563
"""Returns a list of the agents contained in the nodes identified
15641564
in `cell_list`; nodes with empty content are excluded.
15651565
"""
@@ -1569,7 +1569,7 @@ class NetworkGrid:
15691569
"""Returns a list of all the agents in the network."""
15701570
return self.get_cell_list_contents(self.G)
15711571
1572-
def iter_cell_list_contents(self, cell_list: list[int]) -> Iterator[Agent]:
1572+
def iter_cell_list_contents(self, cell_list: list[int] | nx.Graph) -> Iterator[Agent]:
15731573
"""Returns an iterator of the agents contained in the nodes identified
15741574
in `cell_list`; nodes with empty content are excluded.
15751575
"""

0 commit comments

Comments
 (0)