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
Open
Implement NeurodataWithoutBorders/nwb-schema#690: add source_description to EventsTable; add merge/query helpers to NWBFile#2192rly wants to merge 8 commits into
rly wants to merge 8 commits into
Conversation
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 Report✅ All modified and coverable lines are covered by tests.
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
source_descriptionattribute toEventsTable, per nwb-schema#690.AnnotationSeries,BehavioralEvents, andEventsTableclass docstrings to match the revised schemadocstrings.NWBFile.merge_events_tables()andNWBFile.get_all_events()per NWBEP001.NWBFile.create_events_table().Changes
Schema
Points the
nwb-schemasubmodule to the head of nwb-schema#690, which:source_descriptionattribute toEventsTable(free-text label of event origin, e.g."Acquisition system"or"Manual video review")./eventsas the single location for allEventsTableinstances regardless of provenance.BehavioralEventsandAnnotationSeries.EventsTablesource_descriptionparameter in__init__.NWBFilemerge_events_tables(tables)— merges a list ofEventsTableobjects into a single DataFrame indexed and sorted by timestamp, with asource_events_tablecolumn identifying the origin table of each row.get_all_events()— callsmerge_events_tableson all tables inNWBFile.events; returns an empty DataFrame if none exist.create_events_table()— added via__clsconf__; creates and registers anEventsTablewithout requiring a separate import.Docstrings and deprecation warnings
AnnotationSeries,BehavioralEvents,EventsTableclass docstrings updated to match nwb-schema#690.AnnotationSeriesandBehavioralEventsdeprecation warnings now namenwbfile.add_events_table()andnwbfile.create_events_table()as the migration target.🤖 Generated with Claude Code