-
Notifications
You must be signed in to change notification settings - Fork 34
Fix: Ensure DataStub size is updated when the underlying dataset is expanded via a DataPipe #766
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
Conversation
Introduces io.space.getSize to obtain current and maximum dataset dimensions from an HDF5 dataspace identifier. Handles dimension order conversion and unlimited dimension representation for MATLAB compatibility.
- Changed get_space to private method. - Add maxDims property - Added updateSize method, which can be accessed by BoundPipe, as stubs of BoundPipes are expandable and their size can change - Improved subsref override - Support method calls with no output - Support compound indexing
Add test for nested data indexing
- Update DataStub size when dataset is appended/expanded - Delegate detection of current size and max size to datastub
Improve fixture teardown
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #766 +/- ##
=======================================
Coverage 95.59% 95.60%
=======================================
Files 182 183 +1
Lines 6380 6388 +8
=======================================
+ Hits 6099 6107 +8
Misses 281 281 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 refactors the DataStub class to add a maxDims property and introduces a new utility function io.space.getSize for retrieving dataset dimensions. The changes improve code organization by centralizing dimension retrieval logic and enabling BoundPipe to access maximum dimensions through DataStub.
- Introduced
maxDimsdependent property to track maximum dataset dimensions - Created
io.space.getSizeutility function to consolidate dimension retrieval logic - Updated
subsrefto support multiple output arguments for proper nargout behavior - Added
numArgumentsFromSubscriptmethod to handle compound data type indexing
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| +types/+untyped/@DataStub/DataStub.m | Added maxDims property, refactored dimension retrieval to use io.space.getSize, moved get_space to private methods, updated subsref for varargout support, added updateSize and numArgumentsFromSubscript methods |
| +types/+untyped/+datapipe/BoundPipe.m | Simplified constructor to use DataStub.maxDims, added updateSize call after append operation, added type validation for stub property |
| +tests/+unit/dataStubTest.m | Moved test schema generation to TestClassSetup for efficiency, added new test for nested data indexing |
| +tests/+fixtures/ExtensionGenerationFixture.m | Added existence checks before deleting directories and files to prevent errors |
| +io/+space/getSize.m | New utility function that encapsulates HDF5 dimension retrieval and conversion logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Simplifies the logic in the dims and maxDims property getters by calling updateSize instead of duplicating code. Also updates the access level for updateSize to allow access from DataStub and BoundPipe classes.
Co-authored-by: Copilot <[email protected]>
Fix failing test
Motivation
Fix wrong assumption in PR:
That PR changed
DataStubto resolve data type and size once, and keep values cached. However a dataset represented by aDataStubcan change size if expanded via theDataPipe/BoundPipeclass. This PR ensures the size of aDataStubis updated whenever a dataset is expanded via aDataPipeobject.This PR also includes a refactor of
DataStub, adding amaxSizeproperty and improving the way aBoundPiperesolves itscurrent_sizeandmax_size.How to test the behavior?
Checklist
fix #XXwhereXXis the issue number?