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