-
Notifications
You must be signed in to change notification settings - Fork 25
Add MeaningsTable #1376
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
base: dev
Are you sure you want to change the base?
Add MeaningsTable #1376
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1376 +/- ##
==========================================
+ Coverage 92.45% 92.53% +0.08%
==========================================
Files 42 42
Lines 9765 9859 +94
Branches 1983 1998 +15
==========================================
+ Hits 9028 9123 +95
+ Misses 462 461 -1
Partials 275 275 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
oruebel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, the code looks good. I added a few suggestions/comments.
… columns based on PR comments
oruebel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few minor additional suggestion. Feel free to accept/reject as you see fit and ping me again
Co-authored-by: Oliver Ruebel <[email protected]>
Co-authored-by: Oliver Ruebel <[email protected]>
Question: Feedback on BaseDynamicTable / DynamicTable Schema RefactoringWe're considering refactoring the DynamicTable schema hierarchy to support MeaningsTable. I'd like feedback on whether this approach is the right design choice. Proposed ImplementationSchema (hdmf-common-schema/common/table.yaml): BaseDynamicTable:
data_type_inc: Container
# Core table functionality: id, colnames, description, VectorData columns
DynamicTable:
data_type_inc: BaseDynamicTable
groups:
- name: meanings_tables (quantity: '?')
groups:
- data_type_inc: MeaningsTable (quantity: '*')
MeaningsTable:
data_type_inc: BaseDynamicTable # NOT DynamicTable
datasets: [value, meaning]
links: [target -> VectorData]Python (hdmf/common/table.py):
RationaleMeaningsTable should not have its own MeaningsTable (a meanings table for a meanings table is nonsensical), so MeaningsTable extends BaseDynamicTable to avoid inheriting the Pros
Cons
Since we expect most users to use DynamicTable, documentation and tutorials will continue to demonstrate use of DynamicTable instead of BaseDynamicTable. Alternative ApproachKeep a single DynamicTable type and:
QuestionIs the structural enforcement (separate schema types) worth the added complexity, or would validation/restriction in each API on a single DynamicTable type be preferable? |
Thanks for the helpful summary.
Here I would add:
Here, I think the main con is the effort and potential unexpected larger downstream code-changes this may require.
Here, I would argue that we should not artificially restrict this in the API if the schema allows it. A check in the nwb-inspector would make sense or maybe even a warning in the API, but if the schema allows it, then adding this as custom logic seems unwieldy. Theoretically, defining meanings for columns of a meanings table is I think a valid thing to do, in particular since users can add custom columns in a MeaningsTable (which could have information that requires further definition), however, I agree that in most cases this is probably not the right way to do it. I.e., I would argue that we either use:
Personally, I think option 1 is cleaner, but will require significant effort such that the cost for implementing this may out-way the benefit. I think option 2 should be fine, but may require changes down-the-line if/when a real use-case for a Long story short, I think either option should meet the current needs reasonably well, and I think it is mainly a question of spending effort now to prepare for potential use cases vs. waiting for real use cases and spending the effort then. I am personally fine with either approach right now, but the more I think about, I'm starting to lean towards Option 2 (even-though I originally proposed Option 1 😉 ) |
|
I vote for option 2. I think that option 1 is a large modification just to exclude what seems like an edge case. Also, is there similar art on the data frame data model that we can use as a compass? |
Motivation
Requires #1374
Fix #1375
See hdmf-dev/hdmf-common-schema#91 for schema changes
How to test the behavior?
Checklist
CHANGELOG.mdwith your changes?