You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SpikeInterface objects and xarray DataTree conversion functions #3929
I use xarray datatypes for most of my scripts and I feel all spikeinterfaces objects could fit in the xarray datatree datatype with almost no drawback (we keep lazyness, chunks, ...). I would really enjoy to be able to use spikeinterface objects and functions for most of my pipeline, but every now and then, have a function to convert to a xarray datatree and vice-versa (perhaps requiring a specific structure of the datatree).
Are conversions functions from and to xarray datatree a feature that may be added to SpikeInterface in the future?
In a more broad function, my understanding of spikeinterface machinery is that it has its own chunk/lazyness handler, and those mostly operate on time chunks. Would there be any drawback in using xarray with Dask as back-end instead, except for the complete code overhaul ?
Making a direct wrapper on top of sikeinterface object would be very tricky because we would need the internal structure of the underlying formats (binary, zarr, hdf5, or any other type).
Restarting from sractch spikeinterface on top of xarray could be an interesting theorical discussion but will certainly will stay a discussion. spikeinterface like many other projects has been built in the good old fashion cutsom classes + numpy under the wood, this looks very cuting edge today but the code is quite easy to read.
Making a direct wrapper on top of sikeinterface object would be very tricky because we would need the internal structure of the underlying formats (binary, zarr, hdf5, or any other type).
Couldn't we just convert the lazy arrays into dask arrays without caring about the underlying format ?
I'll elaborate on my previous answer: could we not construct a dask delayed using recording.get_traces for each chunk, thus without caring about the underlying file format?
Activity
zm711 commentedon May 16, 2025
@samuelgarcia and @alejoe91 should comment here :)
samuelgarcia commentedon Jun 2, 2025
Hi @JulienBrn
I started a similar idea last year on the neo project. See theses functions https://github.com/NeuralEnsemble/python-neo/blob/master/neo/rawio/xarray_utils.py
This works is quite unfinished. It works only when the file is binary at the moment.
Making a direct wrapper on top of sikeinterface object would be very tricky because we would need the internal structure of the underlying formats (binary, zarr, hdf5, or any other type).
Restarting from sractch spikeinterface on top of xarray could be an interesting theorical discussion but will certainly will stay a discussion. spikeinterface like many other projects has been built in the good old fashion cutsom classes + numpy under the wood, this looks very cuting edge today but the code is quite easy to read.
JulienBrn commentedon Jul 2, 2025
Couldn't we just convert the lazy arrays into dask arrays without caring about the underlying format ?
JulienBrn commentedon Jul 16, 2025
I'll elaborate on my previous answer: could we not construct a dask delayed using recording.get_traces for each chunk, thus without caring about the underlying file format?