Skip to content

Commit

Permalink
Declared trees.py public interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Helveg committed May 29, 2023
1 parent 66e9c7c commit 5fa5c62
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bsb/trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __len__(self):
pass


class BoxRTree(BoxTreeInterface):
class _BoxRTree(BoxTreeInterface):
"""
Tree for fast lookup of queries of axis aligned rhomboids using the Rtree package.
"""
Expand All @@ -37,7 +37,7 @@ def __init__(self, boxes):
self._rtree.insert(id, box)

def __len__(self):
return self._rtree.get_size()
return len(self._rtree)

def query(self, boxes, unique=False):
"""
Expand All @@ -64,5 +64,8 @@ def query(self, boxes, unique=False):


# Cheapo provider. Needs to be a class definition so that the doc reference can be found.
class BoxTree(BoxRTree):
class BoxTree(_BoxRTree):
pass


__all__ = ["BoxTreeInterface", "BoxTree"]

0 comments on commit 5fa5c62

Please sign in to comment.