Skip to content

[codex] Introduce LazyArray abstraction for HDF5-backed DataStub#800

Draft
ehennestad wants to merge 9 commits intorefactor-hdf5-backend-readerfrom
zarr-support/2-add-lazy-array-generalization
Draft

[codex] Introduce LazyArray abstraction for HDF5-backed DataStub#800
ehennestad wants to merge 9 commits intorefactor-hdf5-backend-readerfrom
zarr-support/2-add-lazy-array-generalization

Conversation

@ehennestad
Copy link
Copy Markdown
Collaborator

Summary

This stacked PR implements the milestone 2 lazy-read seam on top of refactor-hdf5-backend-reader.

It introduces a backend-aware LazyArray abstraction for lazy dataset access, adds an HDF5 implementation, and refactors DataStub to delegate lazy reads through that abstraction while keeping scope HDF5-only.

What Changed

  • add io.backend.base.LazyArray
  • add io.backend.hdf5.HDF5LazyArray
  • refactor types.untyped.DataStub to delegate metadata lookup and lazy loads through a backend lazy array
  • update io.backend.hdf5.HDF5Reader to wrap non-scalar non-empty datasets in DataStub backed by HDF5LazyArray
  • extend backend tests and add focused HDF5LazyArray coverage

Why

DataStub previously embedded HDF5-specific dataset metadata and read logic directly. That made lazy reads another HDF5-hardcoded seam in the Phase 1 architecture.

This change moves that responsibility behind a backend abstraction so the public lazy dataset proxy remains stable while storage-specific behavior lives in backend code.

Impact

  • no intended user-facing behavior change for HDF5 reads
  • DataStub remains the public lazy dataset object
  • lazy dataset behavior is now backend-aware, which unblocks future backend expansion without another cross-cutting DataStub refactor

Validation

  • tests.unit.io.backend.BackendFactoryTest
  • tests.unit.io.backend.HDF5LazyArrayTest
  • tests.unit.io.backend.HDF5ReaderTest
  • tests.unit.dataStubTest
  • tests.unit.nwbReadTest
  • tests.unit.io.ParseDatasetTest
  • tests.unit.dataPipeTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants