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

GeoCell size default fix #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

GeoCell size default fix #11

wants to merge 3 commits into from

Conversation

jjnp
Copy link
Contributor

@jjnp jjnp commented Jun 17, 2021

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
It should look like this instead:
image

jjnp added 3 commits June 17, 2021 19:18
This should help prevent bugs in the future, since some bugs already occurred that would have been mitigated by the changes signature and documentation.

Signed-off-by: Jacob Palecek <[email protected]>
This should help prevent bugs in the future, since some bugs already occurred that would have been mitigated by the changes signature and documentation.

Signed-off-by: Jacob Palecek <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant