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
@@ -1551,7 +1551,7 @@ def test_normalize_block_indexing_1d(flatblocks, expected):
15511551 nblocks = 5
15521552 array = dask .array .ones ((nblocks ,), chunks = (1 ,))
15531553 expected = tuple (np .array (i ) if isinstance (i , list ) else i for i in expected )
1554- actual = _normalize_indexes (array , flatblocks , array .blocks .shape )
1554+ actual = _normalize_indexes (array . ndim , flatblocks , array .blocks .shape )
15551555 assert_equal_tuple (expected , actual )
15561556
15571557
@@ -1563,17 +1563,17 @@ def test_normalize_block_indexing_1d(flatblocks, expected):
15631563 ((1 , 2 , 3 ), (0 , slice (1 , 4 ))),
15641564 ((1 , 3 ), (0 , [1 , 3 ])),
15651565 ((0 , 1 , 3 ), (0 , [0 , 1 , 3 ])),
1566- (tuple (range (10 )), (slice (0 , 2 ), slice (None ))),
1567- ((0 , 1 , 3 , 5 , 6 , 8 ), (slice (0 , 2 ), [0 , 1 , 3 ])),
1566+ (tuple (range (10 )), (slice (None , 2 ), slice (None ))),
1567+ ((0 , 1 , 3 , 5 , 6 , 8 ), (slice (None , 2 ), [0 , 1 , 3 ])),
15681568 ((0 , 3 , 4 , 5 , 6 , 8 , 24 ), np .ix_ ([0 , 1 , 4 ], [0 , 1 , 3 , 4 ])),
15691569 ),
15701570)
1571- def test_normalize_block_indexing_2d (flatblocks , expected ) :
1571+ def test_normalize_block_indexing_2d (flatblocks : tuple [ int , ...], expected : tuple [ Any , ...]) -> None :
15721572 nblocks = 5
15731573 ndim = 2
15741574 array = dask .array .ones ((nblocks ,) * ndim , chunks = (1 ,) * ndim )
15751575 expected = tuple (np .array (i ) if isinstance (i , list ) else i for i in expected )
1576- actual = _normalize_indexes (array , flatblocks , array .blocks .shape )
1576+ actual = _normalize_indexes (array . ndim , flatblocks , array .blocks .shape )
15771577 assert_equal_tuple (expected , actual )
15781578
15791579
0 commit comments