@@ -55,7 +55,7 @@ class ArrayIndexError(IndexError):
5555class BoundsCheckError (IndexError ):
5656 _msg = ""
5757
58- def __init__ (self , dim_len : int ):
58+ def __init__ (self , dim_len : int ) -> None :
5959 self ._msg = f"index out of bounds for dimension with length { dim_len } "
6060
6161
@@ -247,7 +247,7 @@ class IntDimIndexer:
247247 dim_chunk_len : int
248248 nitems : int = 1
249249
250- def __init__ (self , dim_sel : int , dim_len : int , dim_chunk_len : int ):
250+ def __init__ (self , dim_sel : int , dim_len : int , dim_chunk_len : int ) -> None :
251251 object .__setattr__ (self , "dim_sel" , normalize_integer_selection (dim_sel , dim_len ))
252252 object .__setattr__ (self , "dim_len" , dim_len )
253253 object .__setattr__ (self , "dim_chunk_len" , dim_chunk_len )
@@ -271,7 +271,7 @@ class SliceDimIndexer:
271271 stop : int
272272 step : int
273273
274- def __init__ (self , dim_sel : slice , dim_len : int , dim_chunk_len : int ):
274+ def __init__ (self , dim_sel : slice , dim_len : int , dim_chunk_len : int ) -> None :
275275 # normalize
276276 start , stop , step = dim_sel .indices (dim_len )
277277 if step < 1 :
@@ -445,7 +445,7 @@ def __init__(
445445 selection : BasicSelection ,
446446 shape : ChunkCoords ,
447447 chunk_grid : ChunkGrid ,
448- ):
448+ ) -> None :
449449 chunk_shape = get_chunk_shape (chunk_grid )
450450 # handle ellipsis
451451 selection_normalized = replace_ellipsis (selection , shape )
@@ -501,7 +501,7 @@ class BoolArrayDimIndexer:
501501 nitems : int
502502 dim_chunk_ixs : npt .NDArray [np .intp ]
503503
504- def __init__ (self , dim_sel : npt .NDArray [np .bool_ ], dim_len : int , dim_chunk_len : int ):
504+ def __init__ (self , dim_sel : npt .NDArray [np .bool_ ], dim_len : int , dim_chunk_len : int ) -> None :
505505 # check number of dimensions
506506 if not is_bool_array (dim_sel , 1 ):
507507 raise IndexError ("Boolean arrays in an orthogonal selection must be 1-dimensional only" )
@@ -618,7 +618,7 @@ def __init__(
618618 wraparound : bool = True ,
619619 boundscheck : bool = True ,
620620 order : Order = Order .UNKNOWN ,
621- ):
621+ ) -> None :
622622 # ensure 1d array
623623 dim_sel = np .asanyarray (dim_sel )
624624 if not is_integer_array (dim_sel , 1 ):
@@ -758,7 +758,7 @@ class OrthogonalIndexer(Indexer):
758758 is_advanced : bool
759759 drop_axes : tuple [int , ...]
760760
761- def __init__ (self , selection : Selection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
761+ def __init__ (self , selection : Selection , shape : ChunkCoords , chunk_grid : ChunkGrid ) -> None :
762762 chunk_shape = get_chunk_shape (chunk_grid )
763763
764764 # handle ellipsis
@@ -865,7 +865,9 @@ class BlockIndexer(Indexer):
865865 shape : ChunkCoords
866866 drop_axes : ChunkCoords
867867
868- def __init__ (self , selection : BasicSelection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
868+ def __init__ (
869+ self , selection : BasicSelection , shape : ChunkCoords , chunk_grid : ChunkGrid
870+ ) -> None :
869871 chunk_shape = get_chunk_shape (chunk_grid )
870872
871873 # handle ellipsis
@@ -990,7 +992,9 @@ class CoordinateIndexer(Indexer):
990992 chunk_shape : ChunkCoords
991993 drop_axes : ChunkCoords
992994
993- def __init__ (self , selection : CoordinateSelection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
995+ def __init__ (
996+ self , selection : CoordinateSelection , shape : ChunkCoords , chunk_grid : ChunkGrid
997+ ) -> None :
994998 chunk_shape = get_chunk_shape (chunk_grid )
995999
9961000 cdata_shape : ChunkCoords
@@ -1107,7 +1111,7 @@ def __iter__(self) -> Iterator[ChunkProjection]:
11071111
11081112@dataclass (frozen = True )
11091113class MaskIndexer (CoordinateIndexer ):
1110- def __init__ (self , selection : MaskSelection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
1114+ def __init__ (self , selection : MaskSelection , shape : ChunkCoords , chunk_grid : ChunkGrid ) -> None :
11111115 # some initial normalization
11121116 selection_normalized = cast (tuple [MaskSelection ], ensure_tuple (selection ))
11131117 selection_normalized = cast (tuple [MaskSelection ], replace_lists (selection_normalized ))
0 commit comments