-
Notifications
You must be signed in to change notification settings - Fork 27
VectorData Refactor Expandable (#1158) #1180
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?
Conversation
* prior * chckpoint * possible poc * fix * finished tests * dtype * fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix again * fix again * clean up * coverage * Update CHANGELOG.md * Update CHANGELOG.md * Update h5tools.py * Update h5tools.py * clean up for review * clean up for review * clean up --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #1180 +/- ##
==========================================
- Coverage 92.86% 92.78% -0.08%
==========================================
Files 41 41
Lines 9919 9940 +21
Branches 2027 2035 +8
==========================================
+ Hits 9211 9223 +12
- Misses 433 437 +4
- Partials 275 280 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@rly This PR is essentially done. I need to go through the pynwb side to make sure what is failing we can ignore through future development. I also want to run the neuroconv tests to make sure those pass as well. |
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.
Pull request overview
This PR implements support for expandable datasets by default and refactors the dimension labels logic to better handle edge cases with varying data shapes and compound dtypes. The changes address issues #1158 and #1163 by:
- Adding an
expandableparameter (defaulting toTrue) throughout the HDF5 write chain - Refactoring
__get_dimension_labels_from_specinto__get_spec_infoto return both dimension labels and matched spec shapes - Using the matched spec shapes to set
maxshapewhen creating datasets, enabling expansion along dimensions defined asNonein the spec - Properly handling compound dtypes when determining data shapes
Changes:
- Added
expandableparameter to write methods (write,write_builder,write_group,write_dataset) with default valueTrue - Refactored dimension label matching logic in
ObjectMapperto also return matched spec shapes - Added
spec_shapesattribute toDatasetBuilderto store matched shapes from specs - Updated
__list_fill__to use matched spec shapes to setmaxshapewhenexpandable=True
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/hdmf/backends/hdf5/h5tools.py |
Added expandable parameter to write methods and updated __list_fill__ to set maxshape based on spec shapes |
src/hdmf/build/objectmapper.py |
Refactored __get_dimension_labels_from_spec to __get_spec_info to return both dimension labels and matched spec shapes; handles compound dtypes correctly |
src/hdmf/build/builders.py |
Added spec_shapes parameter and property to DatasetBuilder |
tests/unit/test_io_hdf5_h5tools.py |
Added tests for expandable datasets, reorganized imports, added test for append functionality |
tests/unit/helpers/utils.py |
Added QuxData and QuxBucket test classes with get_qux_buildmanager helper for testing variable shapes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Motivation
What was the reasoning behind this change? Please explain the changes briefly.
Fix #1158
Fix #1163
Add expandable default for datasets.
How to test the behavior?
Checklist
CHANGELOG.mdwith your changes?