• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openbraininstitute / libsonata / 29263983785
93%

Build:
DEFAULT BRANCH: master
Ran 13 Jul 2026 03:53PM UTC
Jobs 1
Files 20
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Jul 2026 03:51PM UTC coverage: 92.975% (+0.1%) from 92.87%
29263983785

push

github

web-flow
Add ElectrodeReader for SONATA electrode weight files (#56)

Adds an `ElectrodeReader` to libsonata for reading SONATA electrode weight HDF5 files (produced by BlueRecording, consumed by neurodamus for LFP computation).

## What

- **`ElectrodeReader`** class following the `ReportReader`/`SpikeReader` pattern: lazy population loading, sorted index for unsorted node_ids, `openPopulation()` + `getPopulationNames()`
- **`ElectrodeDataFrame`** struct for returning scaling factor submatrices with row/column identity
- **`Population::get(node_ids, electrode_ids)`** — Selection-based access on both axes (`nullopt` = all)
- **Electrode metadata** accessors: names, positions, types
- **Python bindings** with zero-copy numpy arrays (`.ids`, `.electrodes`, `.data`)
- **Test fixture** with two populations (unsorted + sorted node_ids)

## Usage (Python)

```python
from libsonata import ElectrodeReader, Selection

reader = ElectrodeReader('electrode_weights.h5')
pop = reader['NodeA']

df = pop.get()                                         # all nodes, all electrodes
df = pop.get(node_ids=Selection([0, 1, 5]))            # specific nodes
df = pop.get(electrode_ids=Selection([0, 2]))          # specific electrodes
df = pop.get(Selection([0, 1]), Selection([0]))        # both

df.ids         # numpy (n_rows, 2): [node_id, compartment_index]
df.electrodes  # numpy (n_cols,): electrode column indices
df.data        # numpy (n_rows, n_cols): scaling factors
```

## Status

- [x] C++ implementation + Python bindings
- [x] Build verified (all 32 existing C++ tests + 115 Python tests pass)
- [x] C++ tests (in progress)
- [x] Python tests (in progress)

Fix: https://github.com/openbraininstitute/libsonata/issues/54

199 of 211 new or added lines in 1 file covered. (94.31%)

2713 of 2918 relevant lines covered (92.97%)

49.09 hits per line

Uncovered Changes

Lines Coverage ∆ File
12
94.31
src/electrode_reader.cpp
Jobs
ID Job ID Ran Files Coverage
1 29263983785.1 13 Jul 2026 03:53PM UTC 20
92.97
GitHub Action Run
Source Files on build 29263983785
  • Tree
  • List 20
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29263983785
  • 83f35e38 on github
  • Prev Build on master (#29023914461)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc