Repository navigation
fix(binaryfile): export all records in CellBudgetFile.export() - #2893
Merged
wpbonelli merged 4 commits intoNov 16, 2026
Merged
Conversation
export() wrote only the first record per budget text per time step, so budget files with multiple packages of the same type (e.g. several RCH packages) lost all but the first package's records. Records were also written grouped by the requested text order rather than in file order, and imeth was inferred from the data type rather than taken from the header. Iterate over records in file order, as reverse() does, and write each record from its own header and data. Copy text and package names from the header verbatim, preserving their justification. Raise NotImplementedError for imeth values other than 0, 1 and 6 instead of writing them incorrectly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit raised NotImplementedError for imeth values other than 0, 1 and 6, which broke exporting MF2005/MFUSG compact budget files with list-based packages (imeth 2 and 5). These were previously exported as imeth 6, and still are. imeth 3 and 4 records, which were previously written incorrectly, are now expanded to full 3D arrays and written as imeth 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leave imeth 3 and 4 records as they were exported before, as imeth 1, so this change stays limited to exporting multiple packages. Writing MF2005 compact records (imeth 2-5) unchanged is left for a follow-up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The text subset test passed text in file order, so it didn't check that records are written in file order regardless of the order of text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2893 +/- ##
===========================================
+ Coverage 55.5% 72.0% +16.5%
===========================================
Files 644 659 +15
Lines 124135 132478 +8343
===========================================
+ Hits 68947 95488 +26541
+ Misses 55188 36990 -18198
🚀 New features to boost your workflow:
|
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.
CellBudgetFile.export()writes at most one record per budget text per time step, so it silently drops every package after the first when a file has more than one package of the same type. I overlooked this in #2722.Go through records in file order, keeping those that match
textandkstpkper, and write each one from its own header and data. Before, headers and data came from separate lookups that only matched because both took the first result. Consequences:textwas a list, records within each time step were written in the order of that list rather than the order of the file.imethis read from the header rather than guessed from the data