Add EventTable type - #304
Conversation
…dant column tracking
@cboulay great to hear. My current goal is to have this ready for a 0.4 release early/mid August. The main parts for All this is implemented in a sequence of PRs that build on each other. I.e., if you want to give it a try you will only need to checkout the In terms of moving this forward, it would be really helpful if you could try it out and let me know if there are any issues. As usual, feel free to create separate issues, add comments on the PRs directly, or by creating follow-up PR's. Side Note: Another reason I am holding of with the release is because I would like hdmf-dev/hdmf-common-schema#97 to be released first, since that is changing the schema for |
…cquisition Updated DynamicTable configuration to support row-based recording
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