Add meanings table - #302
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds first-class support for the new HDMF Common MeaningsTable type and wires it into DynamicTable, while also improving ElectrodesTable dataset chunking by making row chunk size configurable (defaulting to 100) to avoid inefficient chunking of 1.
Changes:
- Added
src/nwb/hdmf/table/MeaningsTable.*implementing the newMeaningsTableregistered type and initialization logic. - Extended
DynamicTablewith support for creating/readingMeaningsTableinstances (including a conveniencecreateMeaningsTableAPI) and added unit tests. - Updated
ElectrodesTable.initialize/NWBFile::createElectrodesTableand related tests to use and verify a configurable row chunk size.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testRecordingWorkflow.cpp | Updates electrodes table creation to pass a row chunk size and asserts expected HDF5 chunking. |
| tests/testRecordingObjects.cpp | Updates electrodes table creation to pass a row chunk size and asserts expected HDF5 chunking. |
| tests/testNWBFile.cpp | Updates electrodes table creation to pass a row chunk size and asserts expected HDF5 chunking. |
| tests/testMeaningsTable.cpp | Adds new unit tests covering MeaningsTable initialization, chunking, linking, and data read/write. |
| tests/testDynamicTable.cpp | Adds tests for DynamicTable::createMeaningsTable and DynamicTable::readMeaningsTable. |
| tests/CMakeLists.txt | Adds the new testMeaningsTable.cpp to the test target. |
| src/nwb/NWBFile.hpp | Extends createElectrodesTable API with optional rowChunkSize parameter. |
| src/nwb/NWBFile.cpp | Passes rowChunkSize through to ElectrodesTable::initialize. |
| src/nwb/hdmf/table/MeaningsTable.hpp | Introduces the MeaningsTable type and its registered fields (value/meaning/target). |
| src/nwb/hdmf/table/MeaningsTable.cpp | Implements MeaningsTable::initialize (datasets + target link). |
| src/nwb/hdmf/table/DynamicTable.hpp | Adds API/macro support for MeaningsTable plus a convenience creation method. |
| src/nwb/hdmf/table/DynamicTable.cpp | Implements DynamicTable::createMeaningsTable (group creation + initialization). |
| src/nwb/file/ElectrodesTable.hpp | Extends ElectrodesTable::initialize with optional rowChunkSize. |
| src/nwb/file/ElectrodesTable.cpp | Applies rowChunkSize to dataset chunking during initialization. |
| CMakeLists.txt | Adds MeaningsTable.cpp to the library build. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…outBorders/aqnwb into add_meanings_table
…dant column tracking
…ce with HDMF 1.10 schema
…cquisition Updated DynamicTable configuration to support row-based recording
Add EventTable type
This was referenced Jul 23, 2026
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.
Fix #284
Implement new
MeaningsTabletype:src/nwb/hdmf/table/MeaningsTable.*source forMeaningsTableMeaningsTableUpdate
DynamicTableto support addingMeaningsTables:readMeaningsTablefor readingMeaningsTablesassociated with aDynamicTable. This also createscreateMeaningsTableInstancemethods for creatin a newMeaningsTablesthat is not yet initialized.DynamicTable.createMeaningsTablemethods for creating a fully initializedMeaningsTablethat is associated with a particular column of theDynamicTableDynamicTable.createMeaningsTableandDynamicTable.readMeaningsTablemethods.- [ ] Update the docs/tutorials as necessary to describe the use of MeaningsTable alongside DynamicTableThis will be part of follow-up once the full stack for EventsTable has been addedOther Changes
ElectrodesTable.initializeto add a new optional parameterrowChunkSize. Similar to theMeaningsTablethe existingElectrodesTablealso creates pre-defined columns ininitialize. Currently the chunking was set inElectrodesTableto1, which is too small. AddingrowChunkSizeincreases the default to 100 and allows the caller to set the chunk size.From #304 : Add EventsTable type
Fix #285
Add support for
EventsTableEventTabletypeEventTabletypeevents/group and addedNWBFile::createEventsTableconvenience functionEnhance
DynamicTableto improve support for use during acquisitionDynamicTableso it creates and initializes itsElementIdentifiersidcolumn internally duringinitialize(). This is to ensure theElementIdentifiersare always create before we start the recording. CallingDynamicTable::setRowIDs()previously required creation ofElementIdentifiersbut may be called later during recording. As part of this change,setRowIDs()now takes only the row ID values and writes them directly to the table's built-inidcolumn instead of accepting a separateElementIdentifiersobject. In practice this aligns the API with the intended usage, since callers should have always used the table's owniddataset. (@oruebel, #302)DynamicTablecolumn-name management to be immediate and table-driven.addColumnName()now flushes new column names to the file as columns are added,setColNames()is now restricted to reordering the existing set of columns (it no longer acts as a general overwrite mechanism), andfinalize()no longer writes thecolnamesattribute because column-name updates are persisted when they occur. This ensures that thecolnamesattribute is always consistent with the actual columns in the table and helps avoid creation of invalid files. (@oruebel, #304)Other
TimestampVectorDataandDurationVectorData; e.g, bad namespace and inconsistent ordering of parameters in initializeFrom #305 : Row-based Recordings
Fix #303
Problem: The current implementation of
DynamicTableis mainly designed for the purpose of metadata tables, e.g.,ElectrodeTable, where we can usually fill in the whole table before the actual acquisition. With the newEventTable, however, we need enhanced support for acquiring the data in the table as part of the acquisition workflow.Goal: Update
DynamicTableandEventTableto simplify row-based recording and configuration of the tableChanges:
addColumnData::DataSpecBaseandData::DataSpec<T>to support runtime configuration ofDynamicTablecolumn layouts and to decouple table schema definition from object initialization. EachDatasubclass (e.g.,VectorData,ElementIdentifiers,TimestampVectorData,DurationVectorData) now exposes a nestedDataSpecstruct that bundles the dataset configuration, description, and any type-specific parameters needed to create and initialize the column.DynamicTable::createDefaultDataSpecsstatic factory to return the default ordered list ofDataSpecobjects for a table (currently just theidcolumn). Subclasses (ElectrodesTable,EventsTable,MeaningsTable) override this to append their own required columns, allowing callers to retrieve, inspect, and customize the default column configuration before passing it toinitialize().DynamicTable::initialize,ElectrodesTable::initialize,EventsTable::initialize, andMeaningsTable::initializeto accept astd::vector<DataSpecPtr>column-spec list instead of individualrowChunkSize/ resolution / flag parameters.DynamicTable::addColumn(DataSpecPtr)overload consistent with the newDataSpec-based API used byinitialize()andcreateDefaultDataSpecs().DyanmicTable::validateDataSpecs(andDynamicTable::checkRequiredColumnNameshelper function) to validate column specifications as part ofDyanmicTable::initializebefore initialization. Also updated subclassed ofDynamicTable(e.g.,ElectrodesTable,EventsTable,MeaningsTable) to overridevalidateDataSpecsto provide their specific validation logic.DynamicTable::addRowandDynamicTable::addRowsmethods to support row-based data insertion into aDynamicTable. Rows are specified asDynamicTable::RowData(anunordered_mapfrom column name toCellValuevariant), enabling type-safe, column-keyed writes without requiring callers to manage per-column buffers directly. Row IDs are auto-generated if not provided.BaseDataType::BaseDataVariantscalar variant type andBaseDataType::createEmptyVectorVarianthelper to support runtime-typed single-cell and buffer operations needed byaddRow/addRows. (@cline, @oruebel, #305)MeaningsTableto a columnsschema_to_aqnwb.pyutility to follow the new structure forDynamicTable. See Update schema_to_aqnwb.py utility to follow the new structure for DynamicTable #314