catalystneuro / lazy_ops

Lazy transposing and slicing of h5py and Zarr Datasets
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

`DatasetView.shape` should override `Dataset.shape` #6

Closed bendichter closed 5 years ago

bendichter commented 5 years ago

dataset_view.shape should be the shape of the view, not the original dataset. I see you have implemented LazyShape, but I think it should just be shape, so that you can use shape to create iterators over the data as you normally would. If you want the shape of the original dataset, you can call dataset_vew._dataset.shape. For this reason maybe we should remove the underscore prefix of the _dataset property and make this dataset_vew.dataset.shape. Would this break anything?

d-sot commented 5 years ago

h5py uses shape internally, and changing shape will break things now or in the future. We can have DatasetView only refer to the h5py.Dataset object and not inherit from it, and then redirect calls to other methods of h5py.Dataset. Should I go ahead with this?

d-sot commented 5 years ago

LazyShape was replaced with shape in f94f6b7b262532d6e97f2d8cb5493d85052bfe9a