55import warnings
66from collections .abc import Callable
77from functools import partial , reduce
8- from typing import TYPE_CHECKING
8+ from typing import TYPE_CHECKING , Any
99from unittest .mock import MagicMock , patch
1010
1111import numpy as np
@@ -1538,7 +1538,7 @@ def test_normalize_block_indexing_1d(flatblocks, expected):
15381538 nblocks = 5
15391539 array = dask .array .ones ((nblocks ,), chunks = (1 ,))
15401540 expected = tuple (np .array (i ) if isinstance (i , list ) else i for i in expected )
1541- actual = _normalize_indexes (array , flatblocks , array .blocks .shape )
1541+ actual = _normalize_indexes (array . ndim , flatblocks , array .blocks .shape )
15421542 assert_equal_tuple (expected , actual )
15431543
15441544
@@ -1550,17 +1550,17 @@ def test_normalize_block_indexing_1d(flatblocks, expected):
15501550 ((1 , 2 , 3 ), (0 , slice (1 , 4 ))),
15511551 ((1 , 3 ), (0 , [1 , 3 ])),
15521552 ((0 , 1 , 3 ), (0 , [0 , 1 , 3 ])),
1553- (tuple (range (10 )), (slice (0 , 2 ), slice (None ))),
1554- ((0 , 1 , 3 , 5 , 6 , 8 ), (slice (0 , 2 ), [0 , 1 , 3 ])),
1553+ (tuple (range (10 )), (slice (None , 2 ), slice (None ))),
1554+ ((0 , 1 , 3 , 5 , 6 , 8 ), (slice (None , 2 ), [0 , 1 , 3 ])),
15551555 ((0 , 3 , 4 , 5 , 6 , 8 , 24 ), np .ix_ ([0 , 1 , 4 ], [0 , 1 , 3 , 4 ])),
15561556 ),
15571557)
1558- def test_normalize_block_indexing_2d (flatblocks , expected ) :
1558+ def test_normalize_block_indexing_2d (flatblocks : tuple [ int , ...], expected : tuple [ Any , ...]) -> None :
15591559 nblocks = 5
15601560 ndim = 2
15611561 array = dask .array .ones ((nblocks ,) * ndim , chunks = (1 ,) * ndim )
15621562 expected = tuple (np .array (i ) if isinstance (i , list ) else i for i in expected )
1563- actual = _normalize_indexes (array , flatblocks , array .blocks .shape )
1563+ actual = _normalize_indexes (array . ndim , flatblocks , array .blocks .shape )
15641564 assert_equal_tuple (expected , actual )
15651565
15661566
0 commit comments