Skip to content

Made NWBSlicer manufacturer-aware.#9

Merged
cboulay merged 1 commit into
mainfrom
dev
May 21, 2026
Merged

Made NWBSlicer manufacturer-aware.#9
cboulay merged 1 commit into
mainfrom
dev

Conversation

@cboulay

@cboulay cboulay commented May 21, 2026

Copy link
Copy Markdown
Member

New helper _match_stream_key(child, stream_keys) in ezmsg-nwb/src/ezmsg/nwb/slicer.py:

  • stream_keys=None → keep literal container name (no change).
  • exact match → use literal name.
  • Else look up the linked Device's manufacturer attribute via child.electrodes.table['group'][0].device.manufacturer. If child.name == f"{manufacturer}_{key}" for some key in stream_keys, treat it as a match and expose the stream under the bare key so slicer.stream_names == ['NPLAY'] and message.key == 'NPLAY' — that way downstream fitters keyed by the user's request still find their data.
  • Manufacturer = "" or "unknown" → no suffix match (avoids accidentally matching unrelated streams that happen to share a suffix when manufacturer metadata isn't present).

New helper _match_stream_key(child, stream_keys) in ezmsg-nwb/src/ezmsg/nwb/slicer.py:
- stream_keys=None → keep literal container name (no change).
- exact match → use literal name.
- Else look up the linked Device's manufacturer attribute via child.electrodes.table['group'][0].device.manufacturer. If child.name == f"{manufacturer}_{key}" for some key in stream_keys, treat it as a match and expose the stream under the bare key so slicer.stream_names == ['NPLAY'] and message.key == 'NPLAY' — that way downstream fitters keyed by the user's request still find their data.
- Manufacturer = "" or "unknown" → no suffix match (avoids accidentally matching unrelated streams that happen to share a suffix when manufacturer metadata isn't present).
@cboulay cboulay merged commit 9abcb13 into main May 21, 2026
14 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.

1 participant