Conversation
- Moved mixin setup and DynamicTable validation logic from fillBody and fillCheck into the main constructor generation flow. - Introduced isDynamicTableDescendent helper for cleaner ancestry checks. - Removed the now-redundant fillCheck function.
Fix warning suppression in sprintf statement (add escape char)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #786 +/- ##
==========================================
- Coverage 95.52% 95.52% -0.01%
==========================================
Files 191 191
Lines 6945 6943 -2
==========================================
- Hits 6634 6632 -2
Misses 311 311 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request refactors the constructor generation logic for neurodata type classes to enable modular construction of target class-specific validation and setup routines. The primary changes consolidate constructor validation/setup code into a single conditional block and fix a critical bug where DynamicTable validation was not being executed.
Changes:
- Refactors constructor generation to consolidate validation and setup code into a single conditional block per class
- Fixes bug where
types.util.dynamictable.checkConfigwas not invoked in DynamicTable constructors - Adds
%#ok<STISA>warning suppression for intentional use ofstrcmp(class(obj), ...)pattern
Reviewed changes
Copilot reviewed 94 out of 94 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| +file/fillConstructor.m | Refactors constructor generation logic to build a single conditional validation block; removes old fillCheck function and adds new isDynamicTableDescendant helper function |
| +tests/+unit/dynamicTableTest.m | Updates test to properly construct DynamicTable with VectorData objects instead of raw data arrays |
| +types/+hdmf_experimental/HERD.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_experimental/EnumData.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_common/VectorIndex.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_common/VectorData.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_common/SimpleMultiContainer.m | Moves setupHasUnnamedGroupsMixin() into conditional block; adds comment and warning suppression |
| +types/+hdmf_common/ElementIdentifiers.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_common/DynamicTableRegion.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_common/DynamicTable.m | Adds checkConfig call to fix validation bug; adds comment and warning suppression |
| +types/+hdmf_common/Data.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_common/Container.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_common/CSRMatrix.m | Adds explanatory comment and warning suppression for class comparison check |
| +types/+hdmf_common/AlignedDynamicTable.m | Consolidates duplicate conditional blocks; moves setupHasUnnamedGroupsMixin() into block; adds comment and warning suppression |
| +types/+core/*.m (70+ files) | Consistently applies refactored constructor pattern with comments, warning suppression, and proper placement of validation/setup code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Motivation
Refactor constructor generator logic for neurodata type classes to facilitate modular construction of target class specific checks and setup routines.
Changes
types.util.dynamictable.checkConfigfunction was not invoked in theDynamicTableconstructor.obj.setupHasUnnamedGroupsMixin()from main constructor body to conditional block that only runs for specific class constructor (not superclass constructor)tests.unit.dynamicTableTest(unrelated, but discovered because of fix in pt 1).How to test the behavior?
N/A
Checklist
fix #XXwhereXXis the issue number?