Skip to content

Add time intervals - #325

Merged
oruebel merged 133 commits into
schema_2_10from
add_time_intervals
Sep 3, 2026
Merged

oruebel merged 133 commits into
schema_2_10from
add_time_intervals

Conversation

@oruebel

@oruebel oruebel commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Fix #323
Fix #324

  • Added new src/nwb/epoch/TimeInterval for annotating time intervals
  • Added new src/nwb/hdmf/table/VectorIndex for storing index columns
  • Added VectorData::appendData and VectorIndex::appendData to simplify appending values to columns
  • Moved implementation in VectorData.hpp to the source VectorData.cpp file
  • Moved definition of CellValue and RowDatas to `Types to avoid circular dependency
  • Enhance CellValue to support both scalar and vector data for support of ragged array columns
  • Updated DynamicTable::addRows etc to support ragged array column write
  • Added DynamicTable::toString to support converting rows to a string representation
  • Added DynamicTable::getNumberOfRows to support retrieving the number of rows in a DynamicTable.
  • Added unit tests for VectorIndex
  • Added unit tests for Timeintervals
  • Added DynamicTable::readRows to support reading of full rows. This also moved CellValue and RowData to Types.hpp. It also added VectorData::readCellValues and VectorIndex::readTargetCellValues.
  • Updated the user tutorial on reading data to specifically discuss reading from DynamicTable
  • Updated NWBFile to support the standard intervals tables, e.g., trials, invalid_time, epochs
  • Updated CHANGELOG
  • Added tutorials for the new TimeIntervals type in docs/pages/userdocs/time_intervals.dox and corresponding new tests/examples/testTimeIntervalsWorkflowExamples.cpp
  • Updated lint.yml workflow to install clang-format via pipx to ensure use of the latest version of clang-format
  • Updated Types.hpp to use a namespace instead of class to group types. For more users this change should not require any code changes since the syntax for accessing the types is the same (e.g., AQNWB::Types::Status), but for users who were using using declarations to import the type can now use using namespace AQNWB::Types.

Additional changes from #328

Fix #327.

  • Updated RegisteredType::create to retrieve objects from the RecordingObjects cache of the I/O if they already exist, rather than creating a new instance. This ensures that multiple requests for the same object path return the exact same object instance.
  • Moved BaseRecordingData cache from RegisteredType to BaseIO, which also ensures that there is only one BaseRecordingObject per Dataset path+io. This makes the caching consistent between objects and datasets by moving all the caches to the I/O and provides stronger consistency in management of objects for users.
  • These changes to caching also allowed us to remove VectorIndex::setTargetColumn from Add time intervals #325. This logic was problematic as it: i) exposed internal logic to avoid duplicate objects to the user and ii) required DynamicTable to updated caches in VectorIndex. By centralizing all the object caches this is no longer necessary.

Future tasks

Copilot AI and others added 29 commits August 13, 2026 04:49
Co-authored-by: oruebel <10999845+oruebel@users.noreply.github.com>
- Add SubjectMetadata struct to NWBFile.hpp with optional fields for
  species, sex, age, description, subjectId, genotype, strain, weight
- Add subject parameter to NWBFile::initialize() defaulting to an empty
  SubjectMetadata{} (creates a Subject group by default); pass
  std::nullopt to explicitly opt out
- Implement subject group creation in createFileStructure() with
  neurodata_type/namespace attributes for NWB compliance
- Update testNWBFile.cpp to expect Subject in findOwnedTypes results
- Update workflow example to demonstrate Subject usage with actual data
- Remove --ignore=check_subject_exists from tests.yml and
  upgrade_schema.yml CI workflows

Co-authored-by: oruebel <10999845+oruebel@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>
@oruebel oruebel added this to the 0.5.0 milestone Aug 16, 2026
oruebel and others added 14 commits September 2, 2026 12:22
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>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…s for root groups, e.g, /events and /intervals
…for efficient runtime check for data type matches to safeguard VectorData::appendData and appendBuffer
typed data facades transient, and document the revised factory behavior.
@oruebel

oruebel commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

I made a few comments. Otherwise this is good to go.

Thanks for the helpful comments @rly . I've addressed all remaining threads here.

…ject-required-by-default

Make Subject required by default in NWBFile::initialize()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: enhancement proposed enhancements or new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants