hdmf icon indicating copy to clipboard operation
hdmf copied to clipboard

Fix #1148 : Add passthrough on non-DCI H5DataIO to support its use in pynwb TimeSeries.

Open cboulay opened this issue 7 months ago • 1 comments

Fix #1148

Motivation

What was the reasoning behind this change? Please explain the changes briefly.

As explained in #1148 and pynwb #1929, when a pynwb.TimeSeries object is created where (1) its data is a H5DataIO object that DOES NOT wrap a DataChunkIterator, AND (2) its timestamps are provided explicitly (vs rate and starting_time), then the TimeSeries object crashes because it cannot access the maxshape attribute on its data value.

With this change, the H5DataIO has a new maxshape property which passes through the correct maxshape if known (either set during __init__ or inferred from the dataset) else None, and pynwb.TimeSeries no longer crashes.

How to test the behavior?

I added a unit test in unit/test_io_hdf5_h5tools.py

Checklist

  • [x] Did you update CHANGELOG.md with your changes?
  • [x] Does the PR clearly describe the problem and the solution?
  • [x] Have you reviewed our Contributing Guide?
  • [x] Does the PR use "Fix #XXX" notation to tell GitHub to close the relevant issue numbered XXX when the PR is merged?

cboulay avatar Jul 10 '24 16:07 cboulay