Skip to content

feat: add AlignedDynamicTable category validation utilities#833

Merged
ehennestad merged 25 commits into
codex/report-schema-violation-contextfrom
codex/aligned-dynamic-table-add-category
Jun 25, 2026
Merged

feat: add AlignedDynamicTable category validation utilities#833
ehennestad merged 25 commits into
codex/report-schema-violation-contextfrom
codex/aligned-dynamic-table-add-category

Conversation

@ehennestad

@ehennestad ehennestad commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

Accidentally merged to wrong branch, see PR #837 instead

@ehennestad ehennestad changed the title feat: add aligned dynamic table categories feat: add aligned dynamic table category utilities Jun 21, 2026
@ehennestad ehennestad changed the title feat: add aligned dynamic table category utilities feat: add `AlignedDynamicTable category utilities Jun 21, 2026
@ehennestad ehennestad changed the title feat: add `AlignedDynamicTable category utilities feat: add AlignedDynamicTable category utilities Jun 21, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes bug where column height calculation ignored a non-zero offset for a DataPipe. Probably rare, non-zero offset is supported by api and should be accounted for.

@ehennestad ehennestad marked this pull request as ready for review June 23, 2026 10:22
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.94203% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.13%. Comparing base (ad0fcb0) to head (60d8028).
⚠️ Report is 29 commits behind head on codex/report-schema-violation-context.

Files with missing lines Patch % Lines
+matnwb/+neurodata/AlignedDynamicTableBase.m 85.89% 22 Missing ⚠️
...es/+util/+dynamictable/+internal/getColumnHeight.m 90.00% 2 Missing ⚠️
...nternal/collectConstantPropertiesAcrossHierarchy.m 91.66% 1 Missing ⚠️
Additional details and impacted files
@@                            Coverage Diff                            @@
##           codex/report-schema-violation-context     #833      +/-   ##
=========================================================================
- Coverage                                  95.38%   95.13%   -0.26%     
=========================================================================
  Files                                        221      223       +2     
  Lines                                       7894     7913      +19     
=========================================================================
- Hits                                        7530     7528       -2     
- Misses                                       364      385      +21     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces first-class category utilities for AlignedDynamicTable by adding a shared non-generated base class that implements addCategory/getCategory, schema-category routing, and unified runtime validation to enforce category/row-height alignment. It also updates the code generator to emit schema-category discovery hooks and updates the icephys tutorial + unit tests to reflect the new API and stricter alignment validation.

Changes:

  • Add matnwb.neurodata.AlignedDynamicTableBase and integrate it into generated AlignedDynamicTable classes for category registration/lookup and alignment validation.
  • Improve DynamicTable height/id inference utilities (getTableHeight, getColumnHeight, initDynamicTableId) and add unit tests.
  • Update generator logic (constructor/custom-constraint/property hooks) to support schema-defined category discovery and auto-registration; update the icephys tutorial accordingly.

Reviewed changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tutorials/private/mcode/icephys.m Updates tutorial usage to avoid pre-listing categories with populated tables and uses addCategory for custom categories.
+types/+util/+dynamictable/+internal/initDynamicTableId.m Refactors id initialization to handle existing ids/DataPipes more carefully.
+types/+util/+dynamictable/+internal/getTableHeight.m Returns both inferred height and whether height is “established”.
+types/+util/+dynamictable/+internal/getColumnHeight.m Adjusts unbound DataPipe height inference to include offset + queued data.
+types/+hdmf_common/AlignedDynamicTable.m Mixes in AlignedDynamicTableBase and switches validation to ensureAlignedTableConsistency.
+types/+core/IntracellularRecordingsTable.m Uses new alignment consistency validation and auto-registers schema category names on assignment.
+tests/+unit/dynamicTableTest.m Adds tests for new height semantics and id initialization behavior.
+tests/+unit/alignedDynamicTableTest.m Adds comprehensive tests for addCategory/getCategory and alignment validation.
+tests/+doubles/SchemaCategoryAlignedTable.m Test double for a schema-defined category property.
+tests/+doubles/ElementIdentifiersStub.m Minimal ElementIdentifiers test double.
+tests/+doubles/DynamicTableStub.m Minimal DynamicTable test double.
+tests/+doubles/AlignedDynamicTableStub.m Minimal AlignedDynamicTable test double using the new base class.
+matnwb/+neurodata/AlignedDynamicTableBase.m New core implementation of category utilities + alignment validation.
+file/isDynamicTableDescendant.m Removes old descendant check helper.
+file/getPropertyHooks.m Adds generator hooks for AlignedDynamicTable.categories validation + category postset registration.
+file/fillCustomConstraint.m Generates checkCustomConstraint for AlignedDynamicTable to enforce consistency.
+file/fillConstructor.m Generates constructor-time consistency checks for AlignedDynamicTable descendants.
+file/fillClass.m Adds AlignedDynamicTableBase as a superclass and generates schema-category discovery method blocks.
+file/+internal/isDescendantOf.m New generalized “is descendant of” helper for generator logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread +matnwb/+neurodata/AlignedDynamicTableBase.m
Comment thread +matnwb/+neurodata/AlignedDynamicTableBase.m
Comment thread +types/+util/+dynamictable/+internal/initDynamicTableId.m Outdated
Comment thread +matnwb/+neurodata/AlignedDynamicTableBase.m
@ehennestad ehennestad requested a review from bendichter June 24, 2026 12:49
@ehennestad ehennestad enabled auto-merge June 24, 2026 18:57
@ehennestad ehennestad force-pushed the codex/aligned-dynamic-table-add-category branch from 55d3826 to ad0fcb0 Compare June 25, 2026 06:33
@ehennestad ehennestad mentioned this pull request Jun 25, 2026
5 tasks
@ehennestad ehennestad changed the title feat: add AlignedDynamicTable category utilities feat: add AlignedDynamicTable category validation utilities Jun 25, 2026
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
LLM assisted docstring tightening
@ehennestad ehennestad force-pushed the codex/aligned-dynamic-table-add-category branch from ad0fcb0 to 60d8028 Compare June 25, 2026 11:39
@ehennestad ehennestad changed the base branch from main to codex/report-schema-violation-context June 25, 2026 11:39
@ehennestad ehennestad merged commit 80d8e8f into codex/report-schema-violation-context Jun 25, 2026
2 of 13 checks passed
@ehennestad

Copy link
Copy Markdown
Collaborator Author

Accidentally merged via merge queue when base was changed from main to another branch because stacking was needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants