Skip to content

Apply the HDF5 buffer channel selection once in BaseRawWithBufferApiIO - #1983

Open
Arthur031221 wants to merge 1 commit into
NeuralEnsemble:masterfrom
Arthur031221:fix/base-hdf5-buffer-slice
Open

Arthur031221 wants to merge 1 commit into
NeuralEnsemble:masterfrom
Arthur031221:fix/base-hdf5-buffer-slice

Conversation

@Arthur031221

Copy link
Copy Markdown

For HDF5 buffers, BaseRawWithBufferApiIO._get_analogsignal_chunk applies _stream_buffer_slice in the HDF5 branch and then again in the shared code after the if/elif chain. The second selection runs on the array the first one already narrowed. That is harmless for None and slice(None), but slice(0, -1), an index array or a boolean mask returns too few columns or raises IndexError. This removes the first selection.

MaxwellRawIO is the only reader with an HDF5 buffer description and it sets slice(None) for every stream, so master does not hit this today. #1909 needs it to fix the Maxwell load failure in #1702, and I split it out of that PR as suggested there.

The new test_baserawio.py reads an HDF5 dataset through BaseRawWithBufferApiIO for both time_axis values and five selections. Without the change 6 subtests fail, with it all pass: pytest -q neo/test/rawiotest/test_baserawio.py.

Assisted by Claude/Codex.

For HDF5 buffers, _get_analogsignal_chunk applied _stream_buffer_slice in
the HDF5 branch and then again in the shared code after the if/elif
chain. The second selection ran on the array the first one had already
narrowed. That is harmless for None and slice(None), but slice(0, -1),
an index array or a boolean mask returned too few columns or raised
IndexError. Remove the selection in the HDF5 branch.

Add a test that reads an HDF5 dataset through BaseRawWithBufferApiIO for
both time_axis values and several selections.

This branch has not been deployed

No deployments
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.

1 participant