Summary
Add an optional fast-path interface so metadata-only properties (dims, shape, dtype, dimension ordering) can be served without forcing construction of the full delayed dask task graph via xarray_dask_data.
Today, in bioio_base/reader.py these properties route through xarray_dask_data:
dtype → self.xarray_dask_data.dtype
shape → self.xarray_dask_data.shape
dims → Dimensions(dims=self.xarray_dask_data.dims, shape=self.shape)
Building the task graph can be computationally expensive, and many formats expose dimension sizes / dtype in metadata directly.
Proposed change
- Define an optional hook (e.g. overridable methods/properties) that subclasses can implement to provide
dims/shape/dtype cheaply from native metadata.
- Default base-class behavior falls back to the existing
xarray_dask_data-derived implementation when a reader does not implement the fast path, so behavior is unchanged for those readers.
Tracking
Part of bioio-devs/bioio#197. Coordinated with bioio, bioio-czi, bioio-ome-zarr, bioio-nd2.
Summary
Add an optional fast-path interface so metadata-only properties (
dims,shape,dtype, dimension ordering) can be served without forcing construction of the full delayed dask task graph viaxarray_dask_data.Today, in
bioio_base/reader.pythese properties route throughxarray_dask_data:dtype→self.xarray_dask_data.dtypeshape→self.xarray_dask_data.shapedims→Dimensions(dims=self.xarray_dask_data.dims, shape=self.shape)Building the task graph can be computationally expensive, and many formats expose dimension sizes / dtype in metadata directly.
Proposed change
dims/shape/dtypecheaply from native metadata.xarray_dask_data-derived implementation when a reader does not implement the fast path, so behavior is unchanged for those readers.Tracking
Part of bioio-devs/bioio#197. Coordinated with
bioio,bioio-czi,bioio-ome-zarr,bioio-nd2.