Skip to content

Add fast-path interface for metadata properties (dims, shape, dtype) #72

Description

@BrianWhitneyAI

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:

  • dtypeself.xarray_dask_data.dtype
  • shapeself.xarray_dask_data.shape
  • dimsDimensions(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.

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions