-
Notifications
You must be signed in to change notification settings - Fork 22
Fix NEXRAD Level2 backend compatibility with older files and VCP-0 #312
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
Fix NEXRAD Level2 backend compatibility with older files and VCP-0 #312
Conversation
Addresses backward compatibility issues with historical NEXRAD files and special scan modes: - Fix IndexError when msg_2 metadata is missing (older builds like Build 8.0) - Add validation for corrupted MSG_5 data in VCP-0 maintenance mode files - Handle struct unpacking errors gracefully in MSG_5 elevation data - Improve metadata reading to support different NEXRAD format versions Fixes reading of files like: - s3://unidata-nexrad-level2/2006/05/19/KLOT/KLOT20060519_183423.gz - s3://unidata-nexrad-level2/2005/01/27/KLOT/KLOT20050127_154429.gz - s3://unidata-nexrad-level2/2025/11/19/KLOT/KLOT20251119_121045_V06
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #312 +/- ##
==========================================
- Coverage 93.52% 93.50% -0.02%
==========================================
Files 27 27
Lines 5572 5587 +15
==========================================
+ Hits 5211 5224 +13
- Misses 361 363 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Based on agent review recommendations: - Replace complex inheritance mocking with unittest.mock patterns - Add parametrized test for MSG_5 elevation validation scenarios - Enhance documentation with historical NEXRAD context (Build 8.0, VCP-0) - Simplify test structure while maintaining comprehensive coverage - Add clear test descriptions for different corruption scenarios Tests now cover: - VCP-0 maintenance mode with corrupted elevation counts (40833) - Normal VCP patterns with valid elevation cuts - Empty VCP patterns - Invalid elevation counts exceeding maximum (25) Improves maintainability and follows xradar testing patterns.
…radar into nexrad-backward-compatibility
|
Thanks @kmuehlbauer for mentioning #293, I totally forgot it. With this PR we can close both. Please let me know if something else is required. |
|
Thanks @aladinor! |
history.mdThis PR addresses backward compatibility issues with the NEXRAD Level2 backend when reading historical NEXRAD files and special scan modes.
The NEXRAD backend currently fails with:
msg_2metadatamsg_2metadata with fallback to record 0number_elevation_cutsvalues (0-25) before parsingThe following publicly available files now work correctly:
s3://unidata-nexrad-level2/2006/05/19/KLOT/KLOT20060519_183423.gzs3://unidata-nexrad-level2/2005/01/27/KLOT/KLOT20050127_154429.gzs3://unidata-nexrad-level2/2025/11/19/KLOT/KLOT20251119_121045_V06