Skip to content

Commit

Permalink
Merge pull request #16 from EwoutH/coord_iter_fix
Browse files Browse the repository at this point in the history
Fix coord iter for single agents
  • Loading branch information
Corvince authored Dec 23, 2023
2 parents f9c870d + 7eb6eb8 commit 975bb08
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mesa_interactive/components/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
def get_agent_data_from_coord_iter(agents_per_coordinate):
for agents, (x, y) in agents_per_coordinate:
if agents: # Checking if the list is non-empty
if not isinstance(agents, list):
agents = [agents]
for agent in agents:
agent_data = json.loads(
json.dumps(agent.__dict__, skipkeys=True, default=str)
Expand Down

0 comments on commit 975bb08

Please sign in to comment.