Repository navigation
Conversation
BinaryLayerFile._build_index appended every header to recordarray but, for records whose text did not match (e.g. DRAWDOWN records in a file read as HEAD), skipped neither the data nor the iposarray entry. The next header was then read from the middle of the data block, so files mixing record types (as MODFLOW-2005 output control allows when heads and drawdown share a unit) failed to load or were indexed incorrectly. Skip non-matching records' data, index only matching headers, and raise a clear error when no record matches the requested text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2892 +/- ##
===========================================
+ Coverage 55.5% 72.0% +16.5%
===========================================
Files 644 659 +15
Lines 124135 132506 +8371
===========================================
+ Hits 68947 95507 +26560
+ Misses 55188 36999 -18189
🚀 New features to boost your workflow:
|
wpbonelli
marked this pull request as ready for review
November 16, 2026 22:23
This branch has not been deployed
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.
HeadFile,UcnFileandHeadUFileread one record type from a binary file, selected by thetextargument (e.g. "head"). But when indexing a file, they don't skip records with any othertext, they read the record's header but not its data, then try to read the next header from the start of that unread data. Files with more than one record type therefore fail to load (EOFError, or a pandas length mismatch). MF2005, for example, allows more than one record type in a file, e.g. when heads and drawdown are saved to the same file unit.Fixes:
Files containing a single record type are indexed exactly as before.