Skip to content

Add new GIS example: Solar Adoption model#381

Open
ShreyasN707 wants to merge 9 commits intomesa:mainfrom
ShreyasN707:feature/solar-adoption-example
Open

Add new GIS example: Solar Adoption model#381
ShreyasN707 wants to merge 9 commits intomesa:mainfrom
ShreyasN707:feature/solar-adoption-example

Conversation

@ShreyasN707
Copy link
Contributor

@ShreyasN707 ShreyasN707 commented Mar 12, 2026

Does it belong?

  • No significant overlap with an existing example, or if there is, the overlap is justified
  • The model is well-scoped: the simplest model that demonstrates its idea
  • It showcases Mesa features not already well-covered by other examples
  • It showcases interesting ABM mechanics, dynamics, or phenomena

Is it correct and current?

  • Uses current Mesa APIs (no deprecated schedulers, manual unique_id, dict portrayals, etc.)
  • Runs and visualizes out of the box
  • Deterministic with a fixed rng seed

Is it clean?

  • Minimal: no dead code, unused imports, or unnecessary complexity
  • Clear naming; logic readable without deep domain knowledge
  • README explains what it does, what it demonstrates, and how to run it (concise, links to references for theory)
  • PR follows the template, commits are clean, and there are no unrelated changes

What this example demonstrates

  • Using GeoSpace to manage spatial relationships between agents

  • Loading environmental data with RasterLayer.from_file()

  • Creating agents from GeoJSON using AgentCreator

  • Visualizing the simulation with a Solara dashboard using make_geospace_component, where households change color as they adopt solar

Implementation notes

A data/generate_data.py script generates synthetic households.geojson and solar_radiation.tif files so the example can run without external datasets.

The code follows the standard Mesa example structure and uses the built-in random generator.

The example runs successfully with the existing test_gis_examples.py test suite.

Screenshot from 2026-03-12 18-38-55 Screenshot from 2026-03-12 18-40-11 Screenshot from 2026-03-12 18-40-34 Screenshot from 2026-03-12 18-40-39

@EwoutH
Copy link
Member

EwoutH commented Mar 15, 2026

Thanks for the PR, looks like a cool model.

Could you:

  • Checkout the test failure
  • Request a peer-review (and maybe do one or two yourself)

@ShreyasN707 ShreyasN707 force-pushed the feature/solar-adoption-example branch 2 times, most recently from 5462cec to b5c8936 Compare March 16, 2026 04:35
Copy link
Contributor Author

@ShreyasN707 ShreyasN707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since no one was ready to give a peer review to my PR i reviewed it myself

  • There is no overlap with other examples
  • It showcases interesting ABM mechanics, dynamics or phenomena
  • It showcases Mesa features not already well-covered by other examples
  • Uses current Mesa APIs
  • I tested the running and visualizatoin of it
  • There are no dead code, unused imports, or unnecessary complexity
  • The README explains what it does, what it demonstrates, and how to run it
  • This PR follows the template and commits are clean

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.

2 participants