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

added option for unique/non-unique returns #16

Merged
merged 3 commits into from
Jun 1, 2021
Merged

Conversation

kip-hart
Copy link
Owner

@kip-hart kip-hart commented Jun 1, 2021

Addresses the first comment in (#15) for returning duplicated AABBs in the tree. The default behavior is preserved. To return duplicates, use the option unique=False.

@kip-hart kip-hart self-assigned this Jun 1, 2021
@kip-hart kip-hart linked an issue Jun 1, 2021 that may be closed by this pull request
@kip-hart
Copy link
Owner Author

kip-hart commented Jun 1, 2021

expected behavior tested in:

def test_unique():
tree = AABBTree()
aabb1 = AABB([(0, 1)])
aabb2 = AABB([(0, 1)])
aabb3 = AABB([(0, 1)])
tree.add(aabb1, 'box 1')
tree.add(aabb2, 'box 2')
vals = tree.overlap_values(aabb3, unique=True)
assert len(vals) == 1
vals = tree.overlap_values(aabb3, unique=False)
assert len(vals) == 2
assert 'box 1' in vals
assert 'box 2' in vals

@kip-hart kip-hart merged commit dcadb9b into master Jun 1, 2021
@kip-hart kip-hart deleted the unique-return-option branch June 1, 2021 19:41
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.

return of overlap_values
1 participant