fix(binaryread): raise/handle EOFError, deprecate vartype=str#2226
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2226 +/- ##
=========================================
+ Coverage 68.0% 70.8% +2.8%
=========================================
Files 294 294
Lines 58880 59026 +146
=========================================
+ Hits 40061 41826 +1765
+ Misses 18819 17200 -1619
|
|
Thanks for this @mwtoews. The binary readers have been needing some updates. Appreciate you taking it on. Time to get past the python2 hangover. |
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.
This fixes issues while reading some binaryfiles with auto precision detection, and also modernizes a few aspects of flopy.utils.binaryfile left-over from python2.
There are two changes to
flopy.utils.binaryfile.binaryread():vartype=str, sincebytesis the the return type with Python3Other refactors:
bytesto a list of int, then check if bytes are within range.encode("ascii")where appropriateExamples of issues
CellBudgetFile
Reading a cell budget file that contains
imeth=5withprecision="auto"(the default):previously this will hang indefinitely since it is attempting to read data at the end of the file without raising any exception. This example is fixed with this PR.
HeadFile
And this is not so much a fix, but a less confusing error:
the exception is changed from:
to:
I have some pending changes to resolve this issue, due after this one.