-
Notifications
You must be signed in to change notification settings - Fork 26
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
Have VectorData expandable by default #1064
Conversation
Note: This could be done by next release if backwards compatibility does not raise an issue. Otherwise it will be Future (the current set milestone). |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1064 +/- ##
==========================================
- Coverage 88.68% 88.53% -0.15%
==========================================
Files 45 45
Lines 9740 9606 -134
Branches 2768 2732 -36
==========================================
- Hits 8638 8505 -133
Misses 778 778
+ Partials 324 323 -1 ☔ View full report in Codecov by Sentry. |
src/hdmf/common/table.py
Outdated
@@ -42,6 +42,7 @@ class VectorData(Data): | |||
'doc': 'a dataset where the first dimension is a concatenation of multiple vectors', 'default': list()}, | |||
allow_positional=AllowPositional.WARNING) | |||
def __init__(self, **kwargs): | |||
kwargs['data'] = H5DataIO(data=kwargs['data'], maxshape=(None,)) |
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.
Hardcoding H5DataIO
will probably create issues with ZarrIO
. In the best case, ZarrIO
ignores the wrapper and worst case it would fail.... I'm not sure which. For ZarrIO
we should not need to wrap for datasets to be expandable, but the problem is, we won't know which backend will be used until we call write to know which wrapper to use.
Not sure what the best solution is for this. I could imagine a few approaches:
- Have "expandable" as an option on the base
DataIO
class and wrap withDataIO
as a generic wrapper that the specific backend (HD5FIO, ZarrIO etc.) would then need to know how to translate. ---> I think this should be feasible, but would require changes in bothHDF5IO
andZarrIO
- Maybe we would need to wrap in the build process ---> I think this could work, but may be tricky
- Wrap with
H5DataIO
and require that the other backends know how to translate it ---> I don't like this one, because it hard-codes backend-specific wrappers in the Container
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.
This is what was going through my mind as well. I made a note documenting that. I had a expandable field idea.
Motivation
What was the reasoning behind this change? Please explain the changes briefly.
Have VectorData expandable by default:
Questions to look into:
Ideas:
How to test the behavior?
Checklist
CHANGELOG.md
with your changes?