MCPcopy Create free account
hub / github.com/chaimleib/intervaltree / remove

Method remove

intervaltree/intervaltree.py:356–370  ·  view source on GitHub ↗

Removes an interval from the tree, if present. If not, raises ValueError. Completes in O(log n) time.

(self, interval)

Source from the content-addressed store, hash-verified

354 self.add(iv)
355
356 def remove(self, interval):
357 """
358 Removes an interval from the tree, if present. If not, raises
359 ValueError.
360
361 Completes in O(log n) time.
362 """
363 #self.verify()
364 if interval not in self:
365 #print(self.all_intervals)
366 raise ValueError
367 self.top_node = self.top_node.remove(interval)
368 self.all_intervals.remove(interval)
369 self._remove_boundaries(interval)
370 #self.verify()
371
372 def removei(self, begin, end, data=None):
373 """

Callers 6

test_build_treeFunction · 0.95
removeiMethod · 0.95
intersection_updateMethod · 0.95
remove_overlapMethod · 0.95
remove_envelopMethod · 0.95

Calls 1

_remove_boundariesMethod · 0.95

Tested by 1

test_build_treeFunction · 0.76