BlueBrain/libsonata

Provide NumPy indexing for ElementReportReader, SpikePopulation

Opened this issue · 1 comments

Would it be possible to provide access to reports data via NumPy indices? An example

report = ElementReportReader('report.h5')
rep_pop = report['All']

rep_pop[:,10]  # the same as `rep_pop.get(tstart=10.0, tstop=10.0)`

rep_pop[13]  # the same as `rep_pop.get(node_id=13)`

The reason for this is to be able use Dask for reports processing. In particular:

import dask.array as da
dask_report = da.from_array(rep_pop, chunks=(1000, 1000))

cc @mgeplf

I think something like this makes senese under the condition that the full report isn't being loaded into memory.

@asanin-epfl: can you see proof-of-concept this in the python/libsonata/__init__.py with only python code? Please make sure to test that the full report isn't being loaded into memory.