feat: Add CDF/HDF5 and DataOrg file support (#72)#73
Open
sahiljhawar wants to merge 7 commits into
Open
Conversation
- Add new readers for HDF5 and CDF and switch to monthly dataset handling. - Introduce dataorg flag and extend preferred_extension to include `cdf` and `h5`'. - Replace prints/warnings with logging, add per-format caching, and enforce validation rules for dataorg vs pickle usage.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends RBMDataSet’s file-loading capabilities toward “monthly dataset” files by adding HDF5/CDF reader plumbing, introducing a dataorg mode flag, broadening allowed preferred_extension values, and migrating user-facing output from print/warnings to logging.
Changes:
- Add HDF5 dataset traversal/reading helper and wire monthly-file caching for
.nc,.h5, and.cdfintoRBMDataSet. - Introduce
dataorgflag and tighten validation rules forpreferred_extensionvsdataorgcombinations. - Replace several
print/warnings.warncall sites withlogging.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
swvo/io/RBMDataSet/utils.py |
Adds logger usage and introduces HDF5/CDF dataset reader helpers alongside existing NetCDF support. |
swvo/io/RBMDataSet/RBMDataSet.py |
Extends extension validation, adds dataorg/monthly-mode selection, and adds per-month caching loaders for .nc/.h5/.cdf. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Dict[str, Any]: A dictionary where keys are the full variable paths | ||
| and values are the corresponding NumPy arrays. | ||
| """ | ||
| pass |
- Log and raise clearer AttributeError when accessing unset VariableLiteral attributes and hint to call `update_from_dict()`; add special guidance for `custom` - Treat ".mat" time variables as POSIX timestamps for monthly datasets and log the assumption - Map variables prefixed with "custom/" into the `custom` dict when loading NetCDF/HDF5/CDF/mat files - Add "# ty:ignore" annotations to silence type-checker warnings in interpolation and script code - Implement CDF reader using `cdflib` to load zVariables and rVariables; warn and return empty dict if file is missing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cdfandh5'.