@@ -277,22 +277,22 @@ def test_oindex():
277277 sel1 = [2 , 5 ]
278278 sel2 = [3 , 3 , 3 , 9 , 3 , 1 , 0 ]
279279 sel = [sel0 , sel1 , sel2 ]
280- sel0_ = np .array (sel0 ).reshape (- 1 ,1 , 1 )
281- sel1_ = np .array (sel1 ).reshape (1 ,- 1 ,1 )
282- sel2_ = np .array (sel2 ).reshape (1 ,1 , - 1 )
280+ sel0_ = np .array (sel0 ).reshape (- 1 , 1 , 1 )
281+ sel1_ = np .array (sel1 ).reshape (1 , - 1 , 1 )
282+ sel2_ = np .array (sel2 ).reshape (1 , 1 , - 1 )
283283
284284 nparr = arr [:]
285- n = nparr [sel0_ ,sel1_ ,sel2_ ]
285+ n = nparr [sel0_ , sel1_ , sel2_ ]
286286 b = arr .oindex [sel ]
287287
288288 np .testing .assert_allclose (b , n )
289289 # Test set
290290 arr .oindex [sel ] = np .zeros (n .shape )
291- nparr [sel0_ ,sel1_ ,sel2_ ] = 0
291+ nparr [sel0_ , sel1_ , sel2_ ] = 0
292292 np .testing .assert_allclose (arr [:], nparr )
293293
294294
295- def test_vindex ():
295+ def test_findex ():
296296 ndim = 3
297297 d = 100
298298 shape = (d ,) * ndim
@@ -310,45 +310,31 @@ def test_vindex():
310310 # i)
311311 b = arr [[m , M // 2 , M ]]
312312 n = nparr [[m , M // 2 , M ]]
313- b2 = arr .vindex [[m , M // 2 , M ]]
314313 np .testing .assert_allclose (b , n )
315- np .testing .assert_allclose (b2 , n )
316314 # ii)
317315 b = arr [[[m // 2 , M // 2 ], [m // 4 , M // 4 ]]]
318316 n = nparr [[[m // 2 , M // 2 ], [m // 4 , M // 4 ]]]
319- b2 = arr .vindex [[[m // 2 , M // 2 ], [m // 4 , M // 4 ]]]
320317 np .testing .assert_allclose (b , n )
321- np .testing .assert_allclose (b2 , n )
322318 # iii)
323319 b = arr [row , col ]
324320 n = nparr [row , col ]
325- b2 = arr .vindex [row , col ]
326321 np .testing .assert_allclose (b , n )
327- np .testing .assert_allclose (b2 , n )
328322 # iv)
329323 b = arr [row [:, None ], col ]
330324 n = nparr [row [:, None ], col ]
331- b2 = arr .vindex [row [:, None ], col ]
332325 np .testing .assert_allclose (b , n )
333- np .testing .assert_allclose (b2 , n )
334326 # v)
335327 b = arr [m , col ]
336328 n = nparr [m , col ]
337- b2 = arr .vindex [m , col ]
338329 np .testing .assert_allclose (b , n )
339- np .testing .assert_allclose (b2 , n )
340330 # vi)
341331 b = arr [1 : M // 2 : 5 , col ]
342332 n = nparr [1 : M // 2 : 5 , col ]
343- b2 = arr .vindex [1 : M // 2 : 5 , col ]
344333 np .testing .assert_allclose (b , n )
345- np .testing .assert_allclose (b2 , n )
346334 # vii)
347335 b = arr [row [:, None ], mask ]
348336 n = nparr [row [:, None ], mask ]
349- b2 = arr .vindex [row [:, None ], mask ]
350337 np .testing .assert_allclose (b , n )
351- np .testing .assert_allclose (b2 , n )
352338 # Transposition test (3rd example is transposed)
353339 b1 = arr [:, [0 , 1 ], 0 ]
354340 b2 = arr [[0 , 1 ], 0 , :]
@@ -360,4 +346,3 @@ def test_vindex():
360346 np .testing .assert_allclose (b1 , n1 )
361347 np .testing .assert_allclose (b2 , n2 )
362348 np .testing .assert_allclose (b3 , n3 )
363-
0 commit comments