@@ -73,23 +73,23 @@ cdef class IntervalTree(IntervalMixin):
73
73
self.root = node_cls(self.left, self.right, indices, leaf_size)
74
74
75
75
@property
76
- def left_sorter(self):
76
+ def left_sorter(self) -> np.ndarray :
77
77
"""How to sort the left labels; this is used for binary search
78
78
"""
79
79
if self._left_sorter is None:
80
80
self._left_sorter = np.argsort(self.left)
81
81
return self._left_sorter
82
82
83
83
@property
84
- def right_sorter(self):
84
+ def right_sorter(self) -> np.ndarray :
85
85
"""How to sort the right labels
86
86
"""
87
87
if self._right_sorter is None:
88
88
self._right_sorter = np.argsort(self.right)
89
89
return self._right_sorter
90
90
91
91
@property
92
- def is_overlapping(self):
92
+ def is_overlapping(self) -> bool :
93
93
"""
94
94
Determine if the IntervalTree contains overlapping intervals.
95
95
Cached as self._is_overlapping.
@@ -109,7 +109,7 @@ cdef class IntervalTree(IntervalMixin):
109
109
return self._is_overlapping
110
110
111
111
@property
112
- def is_monotonic_increasing(self):
112
+ def is_monotonic_increasing(self) -> bool :
113
113
"""
114
114
Return True if the IntervalTree is monotonic increasing (only equal or
115
115
increasing values), else False
@@ -119,7 +119,7 @@ cdef class IntervalTree(IntervalMixin):
119
119
sort_order = np.lexsort(values)
120
120
return is_monotonic(sort_order, False)[0]
121
121
122
- def get_indexer(self, scalar_t[:] target):
122
+ def get_indexer(self, scalar_t[:] target) -> np.ndarray :
123
123
"""Return the positions corresponding to unique intervals that overlap
124
124
with the given array of scalar targets.
125
125
"""
@@ -180,7 +180,7 @@ cdef class IntervalTree(IntervalMixin):
180
180
n_elements=self.root.n_elements))
181
181
182
182
# compat with IndexEngine interface
183
- def clear_mapping(self):
183
+ def clear_mapping(self) -> None :
184
184
pass
185
185
186
186
0 commit comments