-
Notifications
You must be signed in to change notification settings - Fork 943
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: Confusing API with methods with similar names #980
Comments
Yes, except
Disagree. For me it was always clear that neighbors => Agents, neighborhood => Coordinates |
Is it just me or that the dictionary definition of "neighborhood" refers to people, not geographical coordinates? From https://en.wikipedia.org/wiki/Neighbourhood:
|
Well maybe look it up in a dictionary!? From https://www.dictionary.com/browse/neighborhood?s=t
If you would have read the wikipedia just a little bit further, it would also say this:
So both definition exists and I definitely see your point, but actually both definitions are irrelevant in this context. The origin of neighborhoods in the context of ABMs relies on the mathematical definition of neighborhoods, which is just an open set of points that contains a specific point. No people involved |
If |
Since a good method name pattern is something along the line of "verb_object", |
My suggestion for an alternative API is to make it explicit what's being returned. So |
There is a subtle distinction here as
I concur new users will use |
I didn't "choose" The further deletion of |
The pr was merged. Ty. |
#815 (comment) contains argument on why it is beneficial to use |
On reviewing #815, I realized that the caching mechanism of neighborhood has already been incorporated in current main. This means that both |
The class
Grid
has:neighbor_iter
: "Iterate over position neighbors"iter_neighborhood
: "Return an iterator over cell coordinates that are in the neighborhood of a certain point"iter_neighbors
: "Return an iterator over neighbors to a certain point"neighbor_iter
anditer_neighbors
seem to be a duplicate of each other.iter_neighborhood
should probably be callediter_neighbor_coordinates
due to the type of its return value.The text was updated successfully, but these errors were encountered: