-
Notifications
You must be signed in to change notification settings - Fork 929
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
space: Document empties property #1888
Conversation
Document the empties property in the Mesa Space module for the different Grids. I might have overdone it a little, but that's in the spirit of PEP 20: Explicit is better than implicit.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1888 +/- ##
=======================================
Coverage 77.10% 77.10%
=======================================
Files 15 15
Lines 974 974
Branches 214 214
=======================================
Hits 751 751
Misses 195 195
Partials 28 28 ☔ View full report in Codecov by Sentry. |
mesa/space.py
Outdated
@@ -526,6 +535,9 @@ class MultiGrid(_Grid): | |||
bottom-left and [width-1, height-1] is the top-right. If a grid is | |||
toroidal, the top and bottom, and left and right, edges wrap to each other. | |||
|
|||
Unlike SingleGrid, MultiGrid does not inherently track empty cells due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empties
are tracked in MultiGrid
. MultiGrid
inherits from _Grid
, which defines the empties
property.
In [1]: import mesa
g =
In [2]: g = mesa.space.MultiGrid(5,5,False)
In [3]: g.empties
Out[3]:
{(0, 0),
(0, 1),
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, will update that (also in HexMulti)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
Merged, thank you. |
Document the empties property in the Mesa Space module for the different Grids.
I might have overdone it a little, but that's in the spirit of PEP 20:
Only documentation changes, no functional ones.