Skip to content

Fix hex_ant and hex_snowflake: migrate to Mesa 3.x visualization API#377

Closed
Harshini2411 wants to merge 4 commits intomesa:mainfrom
Harshini2411:main
Closed

Fix hex_ant and hex_snowflake: migrate to Mesa 3.x visualization API#377
Harshini2411 wants to merge 4 commits intomesa:mainfrom
Harshini2411:main

Conversation

@Harshini2411
Copy link

@Harshini2411 Harshini2411 commented Mar 12, 2026

Fixes #357

Partially addresses #358 (hex_snowflake only)

  • shape_example and charts will be fixed in a separate PR

Changes

hex_ant (Fixes #357)

  • Changed relative import from .agent import Ant to absolute
    import from agent import Ant in model.py

hex_snowflake (Partially addresses #358)

  • Deleted server.py (old ModularServer approach)
  • Created app.py using SolaraViz + make_space_component
  • Updated run.py to import from app.py
  • Deleted portrayal.py (replaced by agent_portrayal in app.py)

Testing

  • Mesa version: 3.5.0
  • Python: 3.x
  • OS: Windows

Harshini2411 and others added 4 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
@Harshini2411 Harshini2411 changed the title Fix hex_ant: replace relative import with absolute import in model.py Fix hex_ant and hex_snowflake: migrate to Mesa 3.x visualization API Mar 12, 2026
@Harshini2411
Copy link
Author

@quaquel ready for review! This fixes hex_ant (relative import error) and hex_snowflake (migrates to SolaraViz). Fixes #357 and partially addresses #358.

@EwoutH
Copy link
Member

EwoutH commented Mar 15, 2026

Thanks for the PR. Are you part of GSoC?

@Harshini2411
Copy link
Author

Hi @EwoutH , I'm currently working on my GSoC proposal for Mesa and this PR is part of my contributions to the project.

@EwoutH
Copy link
Member

EwoutH commented Mar 16, 2026

Cool, please do a self-review and request a peer review.

@Harshini2411
Copy link
Author

Closing this PR in favour of #380 which includes the correct fixes for hex_ant and hex_snowflake using proper nested package structure, along with shape_example and charts migrations. All examples tested locally and working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix hex_ant: relative import error prevents example from running

2 participants