@@ -50,15 +50,15 @@ def test_maybe_indices_to_slice_left_edge(self):
50
50
target = np .arange (100 )
51
51
52
52
# slice
53
- indices = np .array ([], dtype = np .int64 )
53
+ indices = np .array ([], dtype = np .intp )
54
54
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
55
55
56
56
assert isinstance (maybe_slice , slice )
57
57
tm .assert_numpy_array_equal (target [indices ], target [maybe_slice ])
58
58
59
59
for end in [1 , 2 , 5 , 20 , 99 ]:
60
60
for step in [1 , 2 , 4 ]:
61
- indices = np .arange (0 , end , step , dtype = np .int64 )
61
+ indices = np .arange (0 , end , step , dtype = np .intp )
62
62
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
63
63
64
64
assert isinstance (maybe_slice , slice )
@@ -73,7 +73,7 @@ def test_maybe_indices_to_slice_left_edge(self):
73
73
74
74
# not slice
75
75
for case in [[2 , 1 , 2 , 0 ], [2 , 2 , 1 , 0 ], [0 , 1 , 2 , 1 ], [- 2 , 0 , 2 ], [2 , 0 , - 2 ]]:
76
- indices = np .array (case , dtype = np .int64 )
76
+ indices = np .array (case , dtype = np .intp )
77
77
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
78
78
79
79
assert not isinstance (maybe_slice , slice )
@@ -86,7 +86,7 @@ def test_maybe_indices_to_slice_right_edge(self):
86
86
# slice
87
87
for start in [0 , 2 , 5 , 20 , 97 , 98 ]:
88
88
for step in [1 , 2 , 4 ]:
89
- indices = np .arange (start , 99 , step , dtype = np .int64 )
89
+ indices = np .arange (start , 99 , step , dtype = np .intp )
90
90
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
91
91
92
92
assert isinstance (maybe_slice , slice )
@@ -100,7 +100,7 @@ def test_maybe_indices_to_slice_right_edge(self):
100
100
tm .assert_numpy_array_equal (target [indices ], target [maybe_slice ])
101
101
102
102
# not slice
103
- indices = np .array ([97 , 98 , 99 , 100 ], dtype = np .int64 )
103
+ indices = np .array ([97 , 98 , 99 , 100 ], dtype = np .intp )
104
104
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
105
105
106
106
assert not isinstance (maybe_slice , slice )
@@ -113,7 +113,7 @@ def test_maybe_indices_to_slice_right_edge(self):
113
113
with pytest .raises (IndexError , match = msg ):
114
114
target [maybe_slice ]
115
115
116
- indices = np .array ([100 , 99 , 98 , 97 ], dtype = np .int64 )
116
+ indices = np .array ([100 , 99 , 98 , 97 ], dtype = np .intp )
117
117
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
118
118
119
119
assert not isinstance (maybe_slice , slice )
@@ -125,7 +125,7 @@ def test_maybe_indices_to_slice_right_edge(self):
125
125
target [maybe_slice ]
126
126
127
127
for case in [[99 , 97 , 99 , 96 ], [99 , 99 , 98 , 97 ], [98 , 98 , 97 , 96 ]]:
128
- indices = np .array (case , dtype = np .int64 )
128
+ indices = np .array (case , dtype = np .intp )
129
129
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
130
130
131
131
assert not isinstance (maybe_slice , slice )
@@ -137,7 +137,7 @@ def test_maybe_indices_to_slice_both_edges(self):
137
137
138
138
# slice
139
139
for step in [1 , 2 , 4 , 5 , 8 , 9 ]:
140
- indices = np .arange (0 , 9 , step , dtype = np .int64 )
140
+ indices = np .arange (0 , 9 , step , dtype = np .intp )
141
141
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
142
142
assert isinstance (maybe_slice , slice )
143
143
tm .assert_numpy_array_equal (target [indices ], target [maybe_slice ])
@@ -150,7 +150,7 @@ def test_maybe_indices_to_slice_both_edges(self):
150
150
151
151
# not slice
152
152
for case in [[4 , 2 , 0 , - 2 ], [2 , 2 , 1 , 0 ], [0 , 1 , 2 , 1 ]]:
153
- indices = np .array (case , dtype = np .int64 )
153
+ indices = np .array (case , dtype = np .intp )
154
154
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
155
155
assert not isinstance (maybe_slice , slice )
156
156
tm .assert_numpy_array_equal (maybe_slice , indices )
@@ -162,7 +162,7 @@ def test_maybe_indices_to_slice_middle(self):
162
162
# slice
163
163
for start , end in [(2 , 10 ), (5 , 25 ), (65 , 97 )]:
164
164
for step in [1 , 2 , 4 , 20 ]:
165
- indices = np .arange (start , end , step , dtype = np .int64 )
165
+ indices = np .arange (start , end , step , dtype = np .intp )
166
166
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
167
167
168
168
assert isinstance (maybe_slice , slice )
@@ -177,7 +177,7 @@ def test_maybe_indices_to_slice_middle(self):
177
177
178
178
# not slice
179
179
for case in [[14 , 12 , 10 , 12 ], [12 , 12 , 11 , 10 ], [10 , 11 , 12 , 11 ]]:
180
- indices = np .array (case , dtype = np .int64 )
180
+ indices = np .array (case , dtype = np .intp )
181
181
maybe_slice = lib .maybe_indices_to_slice (indices , len (target ))
182
182
183
183
assert not isinstance (maybe_slice , slice )
0 commit comments