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

Move examples into mesa #2387

Merged
merged 5 commits into from
Oct 18, 2024
Merged

Move examples into mesa #2387

merged 5 commits into from
Oct 18, 2024

Conversation

Corvince
Copy link
Contributor

@Corvince Corvince commented Oct 18, 2024

Based on previous discussion and to rectify some errors made in #2381

See commits for atomic changes:

  1. move examples into mesa folder - the main purpose of this PR
  2. remove the "examples" package which was a mistake of Importable examples #2381
  3. Update paths
  4. Add an empty __init__.py file to each basic example. While I find this a bit annoying, I think its actually the best way to make the examples truly portable, combined with relative imports. Each example becomes its own "package" in python speak. Also updated the imports so now you can do from mesa.examples import BoltzmannWealthModel instead of from mesa.examples.basic import BoltzmannWealthModel

Copy link
Member

@quaquel quaquel left a comment

Choose a reason for hiding this comment

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

The move makes sense and should resolve the various issues we have been running into. Thanks!

Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔴 +4.2% [+3.0%, +5.3%] 🔵 -0.3% [-0.5%, -0.2%]
BoltzmannWealth large 🔵 +1.5% [+1.0%, +1.9%] 🔵 +0.8% [+0.6%, +1.1%]
Schelling small 🔵 +0.0% [-0.2%, +0.3%] 🔵 -0.4% [-0.7%, -0.1%]
Schelling large 🔵 +1.1% [+0.4%, +1.9%] 🔴 +6.3% [+5.3%, +7.5%]
WolfSheep small 🔵 +0.3% [+0.1%, +0.5%] 🔵 -0.1% [-0.2%, +0.1%]
WolfSheep large 🔵 +0.3% [-0.3%, +1.0%] 🔵 +0.4% [-1.5%, +2.0%]
BoidFlockers small 🔵 -0.1% [-0.7%, +0.6%] 🔵 +0.7% [-0.1%, +1.3%]
BoidFlockers large 🔵 +0.6% [-0.5%, +1.5%] 🔵 -0.2% [-0.8%, +0.3%]

@Corvince Corvince merged commit d78641e into main Oct 18, 2024
9 of 10 checks passed
@Corvince Corvince deleted the move-examples-into-mesa branch October 18, 2024 19:49
Copy link
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

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

Good stuff, thanks.

Git history is maintained remarkable well!

image

@Corvince
Copy link
Contributor Author

Yes, luckily for git its just a rename operation, since git doesn't know about the concept of folders.

@EwoutH EwoutH added the example Changes the examples or adds to them. label Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Changes the examples or adds to them.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants