@@ -55,7 +55,7 @@ class ArrayIndexError(IndexError):
55
55
class BoundsCheckError (IndexError ):
56
56
_msg = ""
57
57
58
- def __init__ (self , dim_len : int ):
58
+ def __init__ (self , dim_len : int ) -> None :
59
59
self ._msg = f"index out of bounds for dimension with length { dim_len } "
60
60
61
61
@@ -247,7 +247,7 @@ class IntDimIndexer:
247
247
dim_chunk_len : int
248
248
nitems : int = 1
249
249
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 :
251
251
object .__setattr__ (self , "dim_sel" , normalize_integer_selection (dim_sel , dim_len ))
252
252
object .__setattr__ (self , "dim_len" , dim_len )
253
253
object .__setattr__ (self , "dim_chunk_len" , dim_chunk_len )
@@ -271,7 +271,7 @@ class SliceDimIndexer:
271
271
stop : int
272
272
step : int
273
273
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 :
275
275
# normalize
276
276
start , stop , step = dim_sel .indices (dim_len )
277
277
if step < 1 :
@@ -445,7 +445,7 @@ def __init__(
445
445
selection : BasicSelection ,
446
446
shape : ChunkCoords ,
447
447
chunk_grid : ChunkGrid ,
448
- ):
448
+ ) -> None :
449
449
chunk_shape = get_chunk_shape (chunk_grid )
450
450
# handle ellipsis
451
451
selection_normalized = replace_ellipsis (selection , shape )
@@ -501,7 +501,7 @@ class BoolArrayDimIndexer:
501
501
nitems : int
502
502
dim_chunk_ixs : npt .NDArray [np .intp ]
503
503
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 :
505
505
# check number of dimensions
506
506
if not is_bool_array (dim_sel , 1 ):
507
507
raise IndexError ("Boolean arrays in an orthogonal selection must be 1-dimensional only" )
@@ -618,7 +618,7 @@ def __init__(
618
618
wraparound : bool = True ,
619
619
boundscheck : bool = True ,
620
620
order : Order = Order .UNKNOWN ,
621
- ):
621
+ ) -> None :
622
622
# ensure 1d array
623
623
dim_sel = np .asanyarray (dim_sel )
624
624
if not is_integer_array (dim_sel , 1 ):
@@ -758,7 +758,7 @@ class OrthogonalIndexer(Indexer):
758
758
is_advanced : bool
759
759
drop_axes : tuple [int , ...]
760
760
761
- def __init__ (self , selection : Selection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
761
+ def __init__ (self , selection : Selection , shape : ChunkCoords , chunk_grid : ChunkGrid ) -> None :
762
762
chunk_shape = get_chunk_shape (chunk_grid )
763
763
764
764
# handle ellipsis
@@ -865,7 +865,9 @@ class BlockIndexer(Indexer):
865
865
shape : ChunkCoords
866
866
drop_axes : ChunkCoords
867
867
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 :
869
871
chunk_shape = get_chunk_shape (chunk_grid )
870
872
871
873
# handle ellipsis
@@ -990,7 +992,9 @@ class CoordinateIndexer(Indexer):
990
992
chunk_shape : ChunkCoords
991
993
drop_axes : ChunkCoords
992
994
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 :
994
998
chunk_shape = get_chunk_shape (chunk_grid )
995
999
996
1000
cdata_shape : ChunkCoords
@@ -1107,7 +1111,7 @@ def __iter__(self) -> Iterator[ChunkProjection]:
1107
1111
1108
1112
@dataclass (frozen = True )
1109
1113
class 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 :
1111
1115
# some initial normalization
1112
1116
selection_normalized = cast (tuple [MaskSelection ], ensure_tuple (selection ))
1113
1117
selection_normalized = cast (tuple [MaskSelection ], replace_lists (selection_normalized ))
0 commit comments