You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would suggest splitting this functionality in two. I have a use case right now where I need to find all intervals in a given tree that overlap, which the first part of the above code does (which is what i will write), so splitting this up would yield an API like (pls excuse the quick psuedo code):
defget_all_overlaps(self):
forintervalinself:
# TODO this will likely yield duplicate sets, so further refinement is neededyieldtree.overlap(interval)
# suggest 'pruning' as the action to the tree, but remove still finedefprune_all_overlaps(self):
removed= []
foroverlapsinself.get_all_overlaps():
forintervalinoverlaps:
removed.append(interval)
self.remove(interval)
returnremoved
I love this library. I use it A LOT!
One function I would love to have on an IntervalTree is
remove_overlaps
. This would remove anyway interval within the tree that overlaps with another.My current work around is effectively this
The text was updated successfully, but these errors were encountered: