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

Method remove_overlap

intervaltree/intervaltree.py:470–481  ·  view source on GitHub ↗

Removes all intervals overlapping the given point or range. Completes in O((r+m)*log n) time, where: * n = size of the tree * m = number of matches * r = size of the search range (this is 1 for a point)

(self, begin, end=None)

Source from the content-addressed store, hash-verified

468 self.update(other)
469
470 def remove_overlap(self, begin, end=None):
471 """
472 Removes all intervals overlapping the given point or range.
473
474 Completes in O((r+m)*log n) time, where:
475 * n = size of the tree
476 * m = number of matches
477 * r = size of the search range (this is 1 for a point)
478 """
479 hitlist = self.at(begin) if end is None else self.overlap(begin, end)
480 for iv in hitlist:
481 self.remove(iv)
482
483 def remove_envelop(self, begin, end):
484 """

Callers 5

test_interval_removal_72Function · 0.95
__delitem__Method · 0.95
test_emptying_partialFunction · 0.80
test_remove_overlapFunction · 0.80
test_deleteFunction · 0.80

Calls 3

atMethod · 0.95
overlapMethod · 0.95
removeMethod · 0.95

Tested by 4

test_interval_removal_72Function · 0.76
test_emptying_partialFunction · 0.64
test_remove_overlapFunction · 0.64
test_deleteFunction · 0.64