Skip to content

Fix SONATA compartment report mapping - #89

Open
ilkilic wants to merge 3 commits into
mainfrom
fix-sonata-compartment-report-mapping
Open

Fix SONATA compartment report mapping#89
ilkilic wants to merge 3 commits into
mainfrom
fix-sonata-compartment-report-mapping

Conversation

@ilkilic

@ilkilic ilkilic commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix the SONATA mapping generated for compartment and compartment_set reports.

Previously, the writer created one node_ids entry per recording location and generated sequential element_ids. This produced duplicated node IDs when multiple locations were recorded from the same cell.

The report mapping now:

  • writes each node id once
  • groups its recorded elements using index_pointers
  • uses the LibSONATA section ID as element_id, matching Neurodamus
  • preserves separate traces for multiple offsets on the same section.

For example, 20 recording locations on node 0 are now represented as:

node_ids = [0]
index_pointers = [0, 20]

instead of:

node_ids = [0, 0, ..., 0]
index_pointers = [0, 1, ..., 20]

Changes

  • Add the LibSONATA section ID to recording-site metadata.
  • Group report elements by node when generating the H5 mapping.
  • Use section IDs instead of sequential trace indices for element_ids.

@ilkilic ilkilic self-assigned this Aug 6, 2026
@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.21875% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bluecellulab/cell/core.py 93.75% 1 Missing ⚠️
Files with missing lines Coverage Δ
bluecellulab/reports/utils.py 94.94% <100.00%> (+0.18%) ⬆️
bluecellulab/reports/writers/compartment.py 86.81% <100.00%> (+3.47%) ⬆️
bluecellulab/type_aliases.py 100.00% <100.00%> (ø)
tests/test_cell/test_core.py 99.46% <100.00%> (+0.01%) ⬆️
tests/test_reports/test_compartment_writer.py 99.43% <100.00%> (+0.26%) ⬆️
tests/test_reports/test_reports_utils.py 98.47% <100.00%> (+0.14%) ⬆️
bluecellulab/cell/core.py 79.40% <93.75%> (+0.47%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant