Skip to content

Commit 6a731f2

Browse files
authored
Merge pull request #69 from goodspark/support-sorted-containers-2
Support sortedcontainers 2.0
2 parents 1ff87c1 + 8b40fa3 commit 6a731f2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

intervaltree/intervaltree.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ def search(self, begin, end=None, strict=False):
803803
bound_end = boundary_table.bisect_left(end) # exclude final end bound
804804
result.update(root.search_overlap(
805805
# slice notation is slightly slower
806-
boundary_table.iloc[index] for index in xrange(bound_begin, bound_end)
806+
boundary_table.keys()[index] for index in xrange(bound_begin, bound_end)
807807
))
808808

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

827827
def end(self):
828828
"""
@@ -832,7 +832,7 @@ def end(self):
832832
"""
833833
if not self.boundary_table:
834834
return 0
835-
return self.boundary_table.iloc[-1]
835+
return self.boundary_table.keys()[-1]
836836

837837
def range(self):
838838
"""

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def run_tests(self):
5959
setup(
6060
name='intervaltree',
6161
version=version_info['version'],
62-
install_requires=['sortedcontainers'],
62+
install_requires=['sortedcontainers >= 2.0, < 3.0'],
6363
description='Editable interval tree data structure for Python 2 and 3',
6464
long_description=doc.get_rst(),
6565
classifiers=[ # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)