From 8b40fa3180e7454724a54192cf60094278063592 Mon Sep 17 00:00:00 2001 From: Sam Park Date: Fri, 18 May 2018 22:25:17 -0700 Subject: [PATCH] Support sortedcontainers 2.0 This could solve https://github.com/chaimleib/intervaltree/issues/68 --- intervaltree/intervaltree.py | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/intervaltree/intervaltree.py b/intervaltree/intervaltree.py index 4ab6fdb..7d9449f 100644 --- a/intervaltree/intervaltree.py +++ b/intervaltree/intervaltree.py @@ -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 @@ -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): """ @@ -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): """ diff --git a/setup.py b/setup.py index 12ce8d5..493a375 100644 --- a/setup.py +++ b/setup.py @@ -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