-
Notifications
You must be signed in to change notification settings - Fork 34
[codex] Improve dynamic table validation and colnames sync #818
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ecfb6cd
First pass by codex
ehennestad 4457153
Update dynamicTableTest.m
ehennestad baa3aec
Merge branch 'main' into improve-dynamic-table-validation
ehennestad 8b1b01d
Fix checkConfig to apply ignoreList before missingColumnNames assertion
Copilot c03ea42
validateColnames should accept string values
ehennestad 830902a
Merge branch 'improve-dynamic-table-validation' of https://github.com…
ehennestad e1c1da7
Update docstring in checkConfig to reflect recent changes
ehennestad 1bb0c09
Simplify type normalization of colnames in validateColnames
ehennestad 63279a6
Merge branch 'main' into improve-dynamic-table-validation
bendichter effd91b
Merge branch 'main' into improve-dynamic-table-validation
ehennestad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| function hooks = getPropertyHooks(propName, prop, typeName, namespace) | ||
| %GETPROPERTYHOOKS Return custom generator hooks for property validators/setters. | ||
|
|
||
| hooks = struct( ... | ||
| 'ValidatorLines', {{}}, ... | ||
| 'PostsetStatements', {{}}); | ||
|
|
||
| fullClassName = namespace.getFullClassName(typeName); | ||
|
|
||
| if strcmp(fullClassName, 'types.hdmf_common.DynamicTable') ... | ||
| && strcmp(propName, 'colnames') | ||
| hooks.ValidatorLines = { ... | ||
| 'val = types.util.dynamictable.validateColnames(val);' }; | ||
| end | ||
|
|
||
| if file.isDynamicTableDescendant(typeName, namespace) ... | ||
| && isSchemaDefinedDynamicTableColumn(propName, prop) | ||
| hooks.PostsetStatements = { ... | ||
| sprintf('types.util.dynamictable.syncNamedColumn(obj, ''%s'');', propName) }; | ||
| end | ||
| end | ||
|
|
||
| function tf = isSchemaDefinedDynamicTableColumn(propName, prop) | ||
| tf = isa(prop, 'file.Dataset') ... | ||
| && ~prop.isConstrainedSet ... | ||
| && ~strcmp(propName, 'id') ... | ||
| && ~endsWith(propName, '_index'); | ||
| end |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| function tf = isDynamicTableDescendant(name, namespace) | ||
| %ISDYNAMICTABLEDESCENDANT Check if a type inherits from DynamicTable. | ||
|
|
||
| tf = false; | ||
|
|
||
| if strcmp(name, 'DynamicTable') | ||
| tf = true; | ||
| return | ||
| end | ||
|
|
||
| ancestry = namespace.getRootBranch(name); | ||
| for iAncestor = 1:length(ancestry) | ||
| parentRaw = ancestry{iAncestor}; | ||
| typeDefIndex = isKey(parentRaw, namespace.TYPEDEF_KEYS); | ||
| ancestorName = parentRaw(namespace.TYPEDEF_KEYS{typeDefIndex}); | ||
| tf = tf || strcmp(ancestorName, 'DynamicTable'); | ||
| end | ||
| end |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.