Skip to content

Add NWB inspection API with automatic reader detection#20

Merged
ilkilic merged 3 commits into
masterfrom
inspect-nwb
Jun 3, 2026
Merged

Add NWB inspection API with automatic reader detection#20
ilkilic merged 3 commits into
masterfrom
inspect-nwb

Conversation

@ilkilic

@ilkilic ilkilic commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add a public inspect_nwb() API for parsing and inspecting NWB files without requiring callers to know the file layout or protocol names in advance.

Changes

  • Add inspect_nwb() to automatically:
    • detect the appropriate NWB reader
    • discover available protocols
    • parse all traces by default
    • return the selected reader name
    • return lightweight file-level metadata
  • Add NWBInspectionError for unsupported, invalid, or unparseable NWB files.
  • Refactor nwb_reader() to reuse the shared reader-selection logic while preserving its existing interface.
  • Support BBP, VU, AIBS, TRT, and Scala NWB layouts.
  • Add tests for protocol discovery, metadata extraction, protocol filtering, invalid files, missing protocols, and layout detection.

Example

from bluepyefe.reader import inspect_nwb

result = inspect_nwb("recording.nwb")

@ilkilic ilkilic requested a review from AurelienJaquier June 2, 2026 15:07
Comment thread bluepyefe/reader.py
Comment thread bluepyefe/reader.py Outdated
Comment thread bluepyefe/reader.py Outdated
Comment thread bluepyefe/reader.py Outdated
Comment thread bluepyefe/reader.py
Comment thread bluepyefe/reader.py Outdated
Comment thread bluepyefe/reader.py

@AurelienJaquier AurelienJaquier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks!

@ilkilic ilkilic merged commit e15c0eb into master Jun 3, 2026
3 checks passed
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.

2 participants