G-Node / python-neo

Fork of python-neo for maintaining the NIX IO.
https://github.com/NeuralEnsemble/python-neo
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Unrooted data support #1

Open achilleas-k opened 8 years ago

achilleas-k commented 8 years ago

Copied from G-Node/python-neo-nixio#23

I think it might be worth supporting converting of data that is not rooted at a block.

I suppose unrooted might not be the proper term here so allow me to elaborate. Unlike NIX, Neo has no restrictions or requirements for objects and their attributes. Objects can have be completely empty and child objects can exist in a namespace without being attached to a container.

It would be trivial and very useful to support writing of these objects to a file, but since NIX has a more strict data structure, we would attach these unrooted child objects to a default tree. Essentially, this simply requires defining, at most, a block and a group with some default attributes. So when a file is read that simply contains, for instance, an AnalogSignal, the NixIO creates a default Block, a default Group to attach to that Block, and then converts the AnalogSignal to a list of DataArrays that are attached to the Group and written to the file.