diff --git a/xbatcher/generators.py b/xbatcher/generators.py index 17365cb..c2c92d9 100644 --- a/xbatcher/generators.py +++ b/xbatcher/generators.py @@ -42,7 +42,7 @@ def _iterate_through_dataset( dim_slices.append(_slices(dimsize, size, olap)) for slices in itertools.product(*dim_slices): - selector = {key: slice for key, slice in zip(dims, slices)} + selector = dict(zip(dims, slices)) yield selector @@ -188,7 +188,7 @@ def _gen_batches(self) -> dict: else: batches += list(input_generator) - return dict(zip(range(len(batches)), batches)) + return dict(enumerate(batches)) def _iterate_batch_dims(self) -> Any: return _iterate_through_dataset(self.ds, self.batch_dims)