-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
Currently with FastPair.__add__() only a single point can be added at time after calling build():
def __add__(self, p):
self.points.append(p)
if self.initialized:
self._find_neighbor(p)
elif len(self) >= self.min_points:
self.build()
return selfWith some modification, a collection of points could be added to the data structure:
def __add__(self, p):
if isinstance(p, list):
for _p in p:
self._add_1_point(_p)
else:
self._add_1_point(p)
return self
def _add_1_point(self, p):
self.points.append(p)
if self.initialized:
self._find_neighbor(p)
elif len(self) >= self.min_points:
self.build()
return selfSeems like the same could go for FastPair.__sub__()
Thoughts?
cc @gegen07
gegen07