@@ -456,28 +456,30 @@ class ChunkInfo:
456456 def __init__ (
457457 self ,
458458 data_shp : Tuple [int , ...],
459- chunksizes : npt .NDArray ,
460- starting_index_offset : npt .NDArray | None = None ,
459+ chunksizes : npt .NDArray [ np . int64 ] ,
460+ starting_index_offset : npt .NDArray [ np . int64 ] | None = None ,
461461 ):
462462
463463 self .chunksizes = chunksizes
464- self .data_shape = np .asarray (data_shp )
465- self .n_chnk = self .data_shape / chunksizes # may not be int
464+ self .data_shape = np .asarray (data_shp ).astype (np .int64 )
465+ self .n_chnk : npt .NDArray [np .int64 ] = (
466+ self .data_shape / chunksizes
467+ ) # may not be int
466468 self .n_whl_chnk = np .floor (self .n_chnk ).astype (int ) # whole chunks in each dim
467469 self .n_part_chnk = np .ceil (self .n_chnk - self .n_whl_chnk ).astype (int )
468470 self .n_tots = np .prod (self .n_part_chnk + self .n_whl_chnk )
469471
470472 self .ndim = len (data_shp )
471473 if starting_index_offset is None :
472- starting_index_offset = np .zeros (self .data_shape .shape , dtype = int )
473- self .starting_index_offset = starting_index_offset
474+ starting_index_offset = np .zeros (self .data_shape .shape , dtype = np . int64 )
475+ self .starting_index_offset : npt . NDArray [ np . int64 ] = starting_index_offset
474476
475- _si : List [npt .NDArray ] | None = None
476- _ei : List [npt .NDArray ] | None = None
477- _sizes : List [npt .NDArray ] | None = None
477+ _si : List [npt .NDArray [ np . int64 ] ] | None = None
478+ _ei : List [npt .NDArray [ np . int64 ] ] | None = None
479+ _sizes : List [npt .NDArray [ np . int64 ] ] | None = None
478480
479481 @property
480- def si (self ) -> List [npt .NDArray ]:
482+ def si (self ) -> List [npt .NDArray [ np . int64 ] ]:
481483 """
482484 The starting indices of individual chunks by dimension.
483485 Includes any global offset.
@@ -523,7 +525,7 @@ def si(self) -> List[npt.NDArray]:
523525 return self ._si
524526
525527 @property
526- def ei (self ) -> List [npt .NDArray ]:
528+ def ei (self ) -> List [npt .NDArray [ np . int64 ] ]:
527529 """
528530 The ending indices of individual chunks by dimension.
529531 Includes any global offset.
@@ -534,7 +536,7 @@ def ei(self) -> List[npt.NDArray]:
534536 return self ._ei
535537
536538 @property
537- def sizes (self ) -> List [npt .NDArray ]:
539+ def sizes (self ) -> List [npt .NDArray [ np . int64 ] ]:
538540 if self ._sizes is None :
539541 _ = self .si
540542 assert self ._sizes is not None
0 commit comments