@@ -53,18 +53,6 @@ def tree(request, leaf_size):
53
53
54
54
55
55
class TestIntervalTree :
56
- def test_get_loc (self , tree ):
57
- result = tree .get_loc (1 )
58
- expected = np .array ([0 ], dtype = "intp" )
59
- tm .assert_numpy_array_equal (result , expected )
60
-
61
- result = np .sort (tree .get_loc (2 ))
62
- expected = np .array ([0 , 1 ], dtype = "intp" )
63
- tm .assert_numpy_array_equal (result , expected )
64
-
65
- with pytest .raises (KeyError , match = "-1" ):
66
- tree .get_loc (- 1 )
67
-
68
56
def test_get_indexer (self , tree ):
69
57
result = tree .get_indexer (np .array ([1.0 , 5.5 , 6.5 ]))
70
58
expected = np .array ([0 , 4 , - 1 ], dtype = "intp" )
@@ -98,10 +86,6 @@ def test_duplicates(self, dtype):
98
86
left = np .array ([0 , 0 , 0 ], dtype = dtype )
99
87
tree = IntervalTree (left , left + 1 )
100
88
101
- result = np .sort (tree .get_loc (0.5 ))
102
- expected = np .array ([0 , 1 , 2 ], dtype = "intp" )
103
- tm .assert_numpy_array_equal (result , expected )
104
-
105
89
with pytest .raises (
106
90
KeyError , match = "'indexer does not intersect a unique set of intervals'"
107
91
):
@@ -116,17 +100,6 @@ def test_duplicates(self, dtype):
116
100
expected = np .array ([], dtype = "intp" )
117
101
tm .assert_numpy_array_equal (result , expected )
118
102
119
- def test_get_loc_closed (self , closed ):
120
- tree = IntervalTree ([0 ], [1 ], closed = closed )
121
- for p , errors in [(0 , tree .open_left ), (1 , tree .open_right )]:
122
- if errors :
123
- with pytest .raises (KeyError , match = str (p )):
124
- tree .get_loc (p )
125
- else :
126
- result = tree .get_loc (p )
127
- expected = np .array ([0 ], dtype = "intp" )
128
- tm .assert_numpy_array_equal (result , expected )
129
-
130
103
@pytest .mark .parametrize (
131
104
"leaf_size" , [skipif_32bit (1 ), skipif_32bit (10 ), skipif_32bit (100 ), 10000 ]
132
105
)
0 commit comments