Skip to content

Implement NeurodataWithoutBorders/nwb-schema#690: add source_description to EventsTable; add merge/query helpers to NWBFile#2192

Open
rly wants to merge 8 commits into
devfrom
690-events-source-description
Open

Implement NeurodataWithoutBorders/nwb-schema#690: add source_description to EventsTable; add merge/query helpers to NWBFile#2192
rly wants to merge 8 commits into
devfrom
690-events-source-description

Conversation

@rly
Copy link
Copy Markdown
Contributor

@rly rly commented May 15, 2026

Summary

  • Adds the optional source_description attribute to EventsTable, per nwb-schema#690.
  • Updates AnnotationSeries, BehavioralEvents, and EventsTable class docstrings to match the revised schema doc strings.
  • Adds NWBFile.merge_events_tables() and NWBFile.get_all_events() per NWBEP001.
  • Adds NWBFile.create_events_table().

Changes

Schema

Points the nwb-schema submodule to the head of nwb-schema#690, which:

  • Adds the optional source_description attribute to EventsTable (free-text label of event origin, e.g. "Acquisition system" or "Manual video review").
  • Recommends /events as the single location for all EventsTable instances regardless of provenance.
  • Updates deprecation docstrings for BehavioralEvents and AnnotationSeries.

EventsTable

  • New optional source_description parameter in __init__.
  • Updated class docstring to match schema, including the one-event-type-per-table guidance.

NWBFile

  • merge_events_tables(tables) — merges a list of EventsTable objects into a single DataFrame indexed and sorted by timestamp, with a source_events_table column identifying the origin table of each row.
  • get_all_events() — calls merge_events_tables on all tables in NWBFile.events; returns an empty DataFrame if none exist.
  • create_events_table() — added via __clsconf__; creates and registers an EventsTable without requiring a separate import.

Docstrings and deprecation warnings

  • AnnotationSeries, BehavioralEvents, EventsTable class docstrings updated to match nwb-schema#690.
  • AnnotationSeries and BehavioralEvents deprecation warnings now name nwbfile.add_events_table() and nwbfile.create_events_table() as the migration target.

🤖 Generated with Claude Code

rly and others added 7 commits May 15, 2026 00:42
Adds source_description attribute to EventsTable and recommends /events
as the single location for all EventsTable instances.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements NeurodataWithoutBorders/nwb-schema#690: adds the optional
source_description attribute to EventsTable for capturing a short
human-readable label of where events originated (e.g., "Acquisition
system", "Thresholding of analog signal ANALOG1 at 3 V").

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…schema

Updates class docstrings to match the doc keys in nwb-schema#690.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
merge_events_tables concatenates a list of EventsTable objects into a
single DataFrame indexed by timestamp. get_all_events calls it on all
tables in NWBFile.events, returning an empty DataFrame if none exist.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Per NWBEP001: the merged result is sorted by timestamp and includes a
source_events_table column identifying which EventsTable each row came from.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 'create' key to events __clsconf__ so NWBFile.create_events_table()
  is available without importing EventsTable separately
- Narrow merge_events_tables type hint to list[EventsTable]
- Update AnnotationSeries and BehavioralEvents deprecation warnings to
  name add_events_table() and create_events_table() as the migration path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.38%. Comparing base (9231882) to head (9e0201e).

❗ There is a different number of reports uploaded between BASE (9231882) and HEAD (9e0201e). Click for more details.

HEAD has 5 uploads less than BASE
Flag BASE (9231882) HEAD (9e0201e)
unit 4 3
integration 4 0
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2192      +/-   ##
==========================================
- Coverage   95.18%   85.38%   -9.80%     
==========================================
  Files          30       30              
  Lines        2991     3004      +13     
  Branches      444      446       +2     
==========================================
- Hits         2847     2565     -282     
- Misses         86      344     +258     
- Partials       58       95      +37     
Flag Coverage Δ
integration ?
unit 85.38% <100.00%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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