Add AlignedDynamicTable non-generated base class with category table validation#837
Draft
ehennestad wants to merge 27 commits into
Draft
Conversation
…ategories when table is uninitialized
commit 89aaadded34998b5256f3d27b2d6ba73a860a042
Author: ehennestad <ehennestad@gmail.com>
Date: Mon Jun 22 14:41:36 2026 +0200
Update AlignedDynamicTableBase.m
one line validation
commit a756a89f9be70116f32d1c9a23fa44744ff73485
Author: ehennestad <ehennestad@gmail.com>
Date: Mon Jun 22 14:39:20 2026 +0200
refactor: clarify aligned dynamic table helpers
commit a5d5dc30493a5745c069b4b6dcb2fd9bd9cf0397
Author: ehennestad <ehennestad@gmail.com>
Date: Mon Jun 22 13:28:48 2026 +0200
refactor: clarify aligned table consistency validation
commit b5bb8313d0bab73236da507dfe405fdd277124db
Author: ehennestad <ehennestad@gmail.com>
Date: Mon Jun 22 13:24:21 2026 +0200
refactor: extract aligned table height establishment
commit 6716530829ed69e5571624c6fe37fd9236c1394c
Author: ehennestad <ehennestad@gmail.com>
Date: Mon Jun 22 13:03:43 2026 +0200
refactor: rename aligned table consistency validation
commit a9bda90e128ec29bd6401e7aac46b7aeecf1cd9c
Author: ehennestad <ehennestad@gmail.com>
Date: Mon Jun 22 12:49:36 2026 +0200
feat: add aligned dynamic table base
Updated docstrings
LLM assisted docstring tightening
Add test exercising validateUniqueCategoryNames
Add tests for improved coverage
Add test checking that empty datapipe ids are filled if table has/gets established height
Ensure backwards compatibility for pre-PR icephys tutorial syntax showing how to create an IntraCellularRecordings table
…AlignedDynamicTable construction
This was referenced Jun 25, 2026
5 tasks
3 tasks
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.
Motivation
The
AlignedDynamicTableschema defines two requirements in docstrings that cannot be enforced by the generated class alone:AlignedDynamicTable"MUST have the same number of rows" (source).categoriesproperty MUST match the names of category tables in theAlignedDynamicTable(source).Without additional runtime validation, users can create invalid NWB files when using
AlignedDynamicTableor its subtypes.This PR adds validation hooks for
AlignedDynamicTablethrough a custom base class. It also adds convenience APIs so valid tables are easier to construct: schema-defined category tables auto-register incategorieswhen assigned, and custom category tables can be added withaddCategory(name, table).This PR stacks on #836 and uses its schema validation reporting context to maintain backwards-compatibility by making
AlignedDynamicTablevalidation on construction warn instead of error to ensure pre-PRicephystutorial examples can still run without breaking.Example usage (updated snippets from icephys tutorial)
1.
categoriesdo not need to be listed when the table is initialized with rows — assigning a category table later registers it automatically:2. Use
addCategoryfor custom categories instead of the manual two-step:How to test the behavior?
runtests('+tests/+system/AlignedDynamicTableTest.m')Checklist
fix #XXwhereXXis the issue number?🤖 Generated with Codex