def __init__(self, dim_sel, dim_len, dim_chunk_len): # normalize self.start, self.stop, self.step = dim_sel.indices(dim_len) if self.step < 1: err_negative_step() # store attributes self.dim_len = dim_len self.dim_chunk_len = dim_chunk_len self.nitems = max(0, ceildiv((self.stop - self.start), self.step)) self.nchunks = ceildiv(self.dim_len, self.dim_chunk_len)