Skip to content

Commit

Permalink
Merge pull request #69 from goodspark/support-sorted-containers-2
Browse files Browse the repository at this point in the history
Support sortedcontainers 2.0
  • Loading branch information
chaimleib authored May 28, 2018
2 parents 1ff87c1 + 8b40fa3 commit 6a731f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions intervaltree/intervaltree.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ def search(self, begin, end=None, strict=False):
bound_end = boundary_table.bisect_left(end) # exclude final end bound
result.update(root.search_overlap(
# slice notation is slightly slower
boundary_table.iloc[index] for index in xrange(bound_begin, bound_end)
boundary_table.keys()[index] for index in xrange(bound_begin, bound_end)
))

# TODO: improve strict search to use node info instead of less-efficient filtering
Expand All @@ -822,7 +822,7 @@ def begin(self):
"""
if not self.boundary_table:
return 0
return self.boundary_table.iloc[0]
return self.boundary_table.keys()[0]

def end(self):
"""
Expand All @@ -832,7 +832,7 @@ def end(self):
"""
if not self.boundary_table:
return 0
return self.boundary_table.iloc[-1]
return self.boundary_table.keys()[-1]

def range(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def run_tests(self):
setup(
name='intervaltree',
version=version_info['version'],
install_requires=['sortedcontainers'],
install_requires=['sortedcontainers >= 2.0, < 3.0'],
description='Editable interval tree data structure for Python 2 and 3',
long_description=doc.get_rst(),
classifiers=[ # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down

0 comments on commit 6a731f2

Please sign in to comment.