Skip to content

Remove overlaps #134

Open
Open
@mbhall88

Description

@mbhall88

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

remove = []
for iv in tree:
    overlaps = list(tree.overlap(iv))
    if len(overlaps) > 1:
        remove.extend(overlaps)

for iv in remove:
    tree.remove(iv)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions