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

cell space: Add convenience properties for grid width and height #2348

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

quaquel
Copy link
Member

@quaquel quaquel commented Oct 12, 2024

90% of all use cases of grid will be 2D so it is convenient to have easy access to the width and the height of the grid.

While porting the examples over to the experimental grid spaces, I frequently need to write self.grid.dimensions[0] etc. This makes it a bit more readable because I can just do self.grid.width etc.

@quaquel quaquel added the enhancement Release notes label label Oct 12, 2024
@quaquel quaquel requested a review from Corvince October 12, 2024 10:55
Copy link

Performance benchmarks:

Model Size Init time [95% CI] Run time [95% CI]
BoltzmannWealth small 🔵 -0.3% [-1.5%, +0.8%] 🔵 -0.2% [-0.3%, -0.0%]
BoltzmannWealth large 🔵 -1.8% [-2.2%, -1.4%] 🔵 -1.5% [-2.1%, -0.9%]
Schelling small 🔵 -0.2% [-0.7%, +0.3%] 🔵 -0.7% [-1.0%, -0.5%]
Schelling large 🔵 +0.0% [-1.6%, +1.5%] 🔵 -0.7% [-1.5%, +0.2%]
WolfSheep small 🔵 -0.5% [-0.7%, -0.3%] 🔵 -0.9% [-1.1%, -0.7%]
WolfSheep large 🔵 -0.4% [-1.2%, +0.4%] 🔵 +0.7% [-0.5%, +2.0%]
BoidFlockers small 🔵 +1.1% [+0.6%, +1.6%] 🔵 +0.1% [-0.5%, +0.7%]
BoidFlockers large 🔵 +0.3% [-0.2%, +0.7%] 🔵 +0.8% [+0.3%, +1.4%]

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.

Nice, we discussed the API before, it clean and convenient.

Thanks!

@EwoutH EwoutH merged commit 3f75fc4 into projectmesa:main Oct 15, 2024
10 of 12 checks passed
@EwoutH EwoutH changed the title Add convenience properties for grid width and height cell space: Add convenience properties for grid width and height Oct 15, 2024
@EwoutH EwoutH added the experimental Release notes label label Oct 15, 2024
@quaquel quaquel deleted the dims branch November 4, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Release notes label experimental Release notes label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants