Skip to content

Add property validation and arguments block to Dataset#13

Merged
stevevanhooser merged 3 commits intomainfrom
refactor-dataset-properties-6869545095348751852
Feb 24, 2026
Merged

Add property validation and arguments block to Dataset#13
stevevanhooser merged 3 commits intomainfrom
refactor-dataset-properties-6869545095348751852

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This change enhances the robustness of the Dataset class by leveraging MATLAB's arguments block and property validation attributes. It ensures that inputs like NativeRate and Channels are strictly validated (positive, integer, etc.) and allows for flexible object initialization via either folder scanning or direct property setting. This supports the requested "fileless" operation mode while preventing invalid configurations. Test coverage is expanded to verify these constraints.


PR created automatically by Jules for task 6869545095348751852 started by @stevevanhooser

- Introduce an `arguments` block in the `Dataset` constructor to handle input validation for `folderPath` and optional Name-Value pairs.
- Add strict validation attributes (e.g., `mustBePositive`, `mustBeInteger`, `mustBeMember`) to all `Dataset` properties.
- Set default values for properties to ensure valid object state upon initialization.
- Update `scanFolder` logic to respect manual overrides from constructor arguments.
- Add `testValidation` to `TestDataset.m` to verify error handling for invalid inputs.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Flatten `Dataset` properties to decouple metadata from file structure (`NativeRate`, `Channels`, `DataType`, `decimationLevels`, etc.).
- Update `Dataset` constructor to use an `arguments` block with sentinel values, allowing robust initialization via folder scanning or explicit Name-Value pairs.
- Implement strict property validation (e.g., `mustBePositive`, `mustBeInteger`) to ensure data integrity.
- Add `getLevelForReading` method to determine optimal read parameters purely from metadata.
- Update `getData` to use `getLevelForReading` and correct `fread` precision type casting.
- Add `testValidation` to `TestDataset.m` and update existing tests.
- Implement an `arguments` block in `Dataset` constructor to handle optional Name-Value pairs with sentinel defaults, enabling flexible "fileless" initialization.
- Flatten `Dataset` metadata properties (`NativeRate`, `Channels`, `decimationLevels`, etc.) and add strict validation attributes (`mustBePositive`, `mustBeInteger`, etc.).
- Update `scanFolder` to populate flattened properties, respecting manual overrides.
- Implement `getLevelForReading` to calculate read parameters purely from metadata.
- Fix `getData` to use `getLevelForReading` and correct precision casting for `fread`.
- Update `TestDataset.m` to verify new properties, logic, and validation (using non-sentinel invalid values).
@stevevanhooser stevevanhooser merged commit 5b0385e into main Feb 24, 2026
6 checks passed
@stevevanhooser stevevanhooser deleted the refactor-dataset-properties-6869545095348751852 branch March 3, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant