@@ -54,7 +54,7 @@ class ArrayIndexError(IndexError):
54
54
class BoundsCheckError (IndexError ):
55
55
_msg = ""
56
56
57
- def __init__ (self , dim_len : int ):
57
+ def __init__ (self , dim_len : int ) -> None :
58
58
self ._msg = f"index out of bounds for dimension with length { dim_len } "
59
59
60
60
@@ -255,7 +255,7 @@ class IntDimIndexer:
255
255
dim_chunk_len : int
256
256
nitems : int = 1
257
257
258
- def __init__ (self , dim_sel : int , dim_len : int , dim_chunk_len : int ):
258
+ def __init__ (self , dim_sel : int , dim_len : int , dim_chunk_len : int ) -> None :
259
259
object .__setattr__ (self , "dim_sel" , normalize_integer_selection (dim_sel , dim_len ))
260
260
object .__setattr__ (self , "dim_len" , dim_len )
261
261
object .__setattr__ (self , "dim_chunk_len" , dim_chunk_len )
@@ -279,7 +279,7 @@ class SliceDimIndexer:
279
279
stop : int
280
280
step : int
281
281
282
- def __init__ (self , dim_sel : slice , dim_len : int , dim_chunk_len : int ):
282
+ def __init__ (self , dim_sel : slice , dim_len : int , dim_chunk_len : int ) -> None :
283
283
# normalize
284
284
start , stop , step = dim_sel .indices (dim_len )
285
285
if step < 1 :
@@ -453,7 +453,7 @@ def __init__(
453
453
selection : BasicSelection ,
454
454
shape : ChunkCoords ,
455
455
chunk_grid : ChunkGrid ,
456
- ):
456
+ ) -> None :
457
457
chunk_shape = get_chunk_shape (chunk_grid )
458
458
# handle ellipsis
459
459
selection_normalized = replace_ellipsis (selection , shape )
@@ -509,7 +509,7 @@ class BoolArrayDimIndexer:
509
509
nitems : int
510
510
dim_chunk_ixs : npt .NDArray [np .intp ]
511
511
512
- def __init__ (self , dim_sel : npt .NDArray [np .bool_ ], dim_len : int , dim_chunk_len : int ):
512
+ def __init__ (self , dim_sel : npt .NDArray [np .bool_ ], dim_len : int , dim_chunk_len : int ) -> None :
513
513
# check number of dimensions
514
514
if not is_bool_array (dim_sel , 1 ):
515
515
raise IndexError ("Boolean arrays in an orthogonal selection must be 1-dimensional only" )
@@ -626,7 +626,7 @@ def __init__(
626
626
wraparound : bool = True ,
627
627
boundscheck : bool = True ,
628
628
order : Order = Order .UNKNOWN ,
629
- ):
629
+ ) -> None :
630
630
# ensure 1d array
631
631
dim_sel = np .asanyarray (dim_sel )
632
632
if not is_integer_array (dim_sel , 1 ):
@@ -766,7 +766,7 @@ class OrthogonalIndexer(Indexer):
766
766
is_advanced : bool
767
767
drop_axes : tuple [int , ...]
768
768
769
- def __init__ (self , selection : Selection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
769
+ def __init__ (self , selection : Selection , shape : ChunkCoords , chunk_grid : ChunkGrid ) -> None :
770
770
chunk_shape = get_chunk_shape (chunk_grid )
771
771
772
772
# handle ellipsis
@@ -880,7 +880,9 @@ class BlockIndexer(Indexer):
880
880
shape : ChunkCoords
881
881
drop_axes : ChunkCoords
882
882
883
- def __init__ (self , selection : BasicSelection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
883
+ def __init__ (
884
+ self , selection : BasicSelection , shape : ChunkCoords , chunk_grid : ChunkGrid
885
+ ) -> None :
884
886
chunk_shape = get_chunk_shape (chunk_grid )
885
887
886
888
# handle ellipsis
@@ -1005,7 +1007,9 @@ class CoordinateIndexer(Indexer):
1005
1007
chunk_shape : ChunkCoords
1006
1008
drop_axes : ChunkCoords
1007
1009
1008
- def __init__ (self , selection : CoordinateSelection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
1010
+ def __init__ (
1011
+ self , selection : CoordinateSelection , shape : ChunkCoords , chunk_grid : ChunkGrid
1012
+ ) -> None :
1009
1013
chunk_shape = get_chunk_shape (chunk_grid )
1010
1014
1011
1015
cdata_shape : ChunkCoords
@@ -1122,7 +1126,7 @@ def __iter__(self) -> Iterator[ChunkProjection]:
1122
1126
1123
1127
@dataclass (frozen = True )
1124
1128
class MaskIndexer (CoordinateIndexer ):
1125
- def __init__ (self , selection : MaskSelection , shape : ChunkCoords , chunk_grid : ChunkGrid ):
1129
+ def __init__ (self , selection : MaskSelection , shape : ChunkCoords , chunk_grid : ChunkGrid ) -> None :
1126
1130
# some initial normalization
1127
1131
selection_normalized = cast (tuple [MaskSelection ], ensure_tuple (selection ))
1128
1132
selection_normalized = cast (tuple [MaskSelection ], replace_lists (selection_normalized ))
0 commit comments