diff --git a/tiled/custom.py b/tiled/custom.py index 5813e20..7a3c716 100644 --- a/tiled/custom.py +++ b/tiled/custom.py @@ -133,6 +133,9 @@ def __iter__(self) -> Iterator[Any]: def __getitem__(self, key: str) -> ArrayAdapter: value = self._group[key] + chunks = value.chunks + shape = value.shape + c0 = min(20*chunks[0], shape[0]) md = dict(value.attrs) if value.dtype == numpy.dtype("O"): @@ -155,8 +158,8 @@ def __getitem__(self, key: str) -> ArrayAdapter: arr = numpy.array(dataset_names) return ArrayAdapter.from_array(arr, metadata=md) return ArrayAdapter.from_array(numpy.array([]), metadata=md) - return ArrayAdapter.from_array(value, metadata=md) - + return ArrayAdapter.from_array(value, metadata=md, chunks=(c0, *chunks[1:])) + def __len__(self) -> int: return 2