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

fix: Reverse dict key and value for agents_by_type #1996

Merged
merged 3 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion benchmarks/global_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# also installed in site_packages or so.
sys.path.insert(0, os.path.abspath(".."))

from configurations import configurations
from configurations import configurations # noqa: E402


# Generic function to initialize and run a model
Expand Down
4 changes: 2 additions & 2 deletions mesa/experimental/components/matplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ def portray(space):
return out

# Determine border style based on space.torus
border_style = 'solid' if not space.torus else (0, (5, 10))
border_style = "solid" if not space.torus else (0, (5, 10))

# Set the border of the plot
for spine in space_ax.spines.values():
spine.set_linewidth(1.5)
spine.set_color('black')
spine.set_color("black")
spine.set_linestyle(border_style)

width = space.x_max - space.x_min
Expand Down
2 changes: 1 addition & 1 deletion mesa/time.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def agents_by_type(self):

agentsbytype = defaultdict(dict)
for k, v in self._agents_by_type.items():
agentsbytype[k] = {agent: agent.unique_id for agent in v}
agentsbytype[k] = {agent.unique_id: agent for agent in v}

return agentsbytype

Expand Down
Loading