Skip to content

Fix shape_example: migrate from ModularServer to SolaraViz (Mesa 3.x)#380

Open
Harshini2411 wants to merge 10 commits intomesa:mainfrom
Harshini2411:fix/shape-example-charts
Open

Fix shape_example: migrate from ModularServer to SolaraViz (Mesa 3.x)#380
Harshini2411 wants to merge 10 commits intomesa:mainfrom
Harshini2411:fix/shape-example-charts

Conversation

@Harshini2411
Copy link

@Harshini2411 Harshini2411 commented Mar 12, 2026

Partially addresses #358

Changes

shape_example:

  • Deleted server.py (old ModularServer approach)
  • Created app.py using SolaraViz + make_space_component
  • Updated Walker to extend CellAgent, added step() method
  • Updated run.py
  • Note: arrowHead not supported in Mesa 3.x, replaced with marker="^"

charts:

  • Deleted server.py (old ModularServer approach)
  • Created app.py using SolaraViz, make_space_component, make_plot_component
  • Uses AgentPortrayalStyle to fix FutureWarning
  • Uses solara.Reactive to fix render loop
  • Updated run.py

Fixes #358

Harshini2411 and others added 8 commits March 11, 2026 21:31
- Renamed server.py to app.py with SolaraViz implementation
- Updated run.py to import from app.py
- Deleted portrayal.py (replaced by agent_portrayal in app.py)

Fixes mesa#358
- Deleted server.py (old ModularServer + CanvasGrid approach)
- Created app.py using SolaraViz + make_space_component
- Updated Walker to use CellAgent for proper grid visualization
- Added step() method to Walker agent
- Updated run.py to import from app.py

Partially addresses mesa#358
@Harshini2411
Copy link
Author

Harshini2411 commented Mar 12, 2026

@quaquel ready for review! This PR fixes both shape_example and charts,
fully addressing #358. Could you approve the CI workflow? Thank you!

@Harshini2411 Harshini2411 force-pushed the fix/shape-example-charts branch from f07473d to b037585 Compare March 13, 2026 05:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix hex_snowflake, shape_example, charts: mesa.visualization no longer exists in Mesa 3.x

1 participant