python-neo icon indicating copy to clipboard operation
python-neo copied to clipboard

RawIO constrains for loading multiple blocks

Open JuliaSprenger opened this issue 2 years ago • 1 comments

When loading data using a RawIO constrains apply: Channels and streams have to be consistent across Segments and Blocks. Many formats only support a single Block containing potentially multiple Segments (e.g. different pieces of the same recording). However more generic formats (like nix) can contain multiple Blocks, e.g. representing different recordings, that do not necessarily share channels and streams.

At the moment it is not possible to store these in a single (nix) file and load them with the RawIO.

This limitation could be lifted by handling streams and channels in a block-wise way, e.g. here.

The alternative is to not be able to combine multiple recordings in a single nix file and having RawIO access, but always load the complete dataset in a non-lazy way using the non-RawIO implementation.

@samuelgarcia What is your opinion on that?

JuliaSprenger avatar Mar 06 '23 10:03 JuliaSprenger

Hi julia. For me by design the rawio need consistentcy across everything (block and segment).

If this is not the case, there is 2 main options:

  • implement the reader in neo.io directly (not ideal because there is not lazy loading)
  • add some kwargs in the init to only one block (or one segment) and then everything is OK.

maxwell format can be multi block because there are several "wells" in in secondary version of the format. In that case a rec_name must explicitly given which lire or less in your case correspond to some kind of block index.

But as a general comment, using the same file to accumulate stuff that are not symetric is not a good practice because all metada around this file will be complicated to handle like the channel table for instance.

samuelgarcia avatar Mar 06 '23 11:03 samuelgarcia