Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should help prevent bugs in the future, since some bugs already occurred that would have been mitigated by the changes signature and documentation.
ATTENTION: This is a breaking change, since it alters the constructor signature of GeoCell. I understand if that isn't acceptable. In that case at least the documentation should remain.
The bug is the following: When using GeoCell, the size determines how often the nodes supplied are iterated on. This is perfectly fine when the 'nodes' are functions that generate those nodes, i.e. if they are callable. If they aren't, however, because someone wanted to supply nodes directly (which is clearly a valid use case since this is specifically checked for in the code), the nodes are materialized instead. Now this is fine generally speaking, but if size > 1, then materialize is called more than once per node, which is incorrect behavior and leads to an incorrect topology.
Because of that I figured it would make sense to change the signature to a variable with a default value of 1, such that someone not knowing what this parameter affects exactly uses a value that doesn't cause problems. I also added documentation outlining that behaviour.
EDIT: This is what a topology looks like if GeoCell is used in the way I outlined:
![image](https://user-images.githubusercontent.com/9217404/122446034-7f295980-cfa2-11eb-8ad2-5b5e95b9a3bd.png)
![image](https://user-images.githubusercontent.com/9217404/122446156-a1bb7280-cfa2-11eb-9ba0-c1cae45103b7.png)
It should look like this instead: