Handle corrupted HDF5 files gracefully in split_containers#114
Open
zcapjdb wants to merge 6 commits intoumami-hep:mainfrom
Open
Handle corrupted HDF5 files gracefully in split_containers#114zcapjdb wants to merge 6 commits intoumami-hep:mainfrom
zcapjdb wants to merge 6 commits intoumami-hep:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #114 +/- ##
==========================================
+ Coverage 94.91% 95.39% +0.48%
==========================================
Files 23 23
Lines 2044 2062 +18
==========================================
+ Hits 1940 1967 +27
+ Misses 104 95 -9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When creating a virtual dataset from multiple h5 files, validate each file before creating symlinks. Corrupted files are logged with a warning and skipped rather than crashing the entire process. Only raises an error if all files are corrupted. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Use 'import logging as log' to match codebase convention - Fix typo: "fiules" -> "files" Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Reorder imports to satisfy ruff linter - Add changelog entry for corrupted HDF5 file handling Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests cover: - Valid HDF5 files returning True - Corrupt files returning False - Non-existent files returning False - Empty files returning False - String path input Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d549137 to
1559d73
Compare
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Tests cover: - Single file path/string handling (yields directly) - All corrupted files (raises RuntimeError) - Mixed files (filters corrupted with warnings) - All valid files (creates VDS without warnings) - Symlink creation (only valid files get symlinked) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Collaborator
|
Nice fix! I wonder if the better approach is to do this check at the prep stage so that we can have this for the resampling approach too. What do you think @afroch, @dkobylianskii? |
Contributor
Tbh. I think this might be a better addition for |
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.
When creating a virtual dataset from multiple h5 files, validate each file before creating symlinks. Corrupted files are logged with a warning and skipped rather than crashing the entire process. Only raises an error if all files are corrupted.
Conformity