fix(modelgrid): retain crs data from classic nam files #1904
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 a bug from #1737 where loading classic NAM files does not retain any CRS information that may be been stored in the header comment.
modelgrid
properties.proj4
and.epsg
are generated from thecrs
inputs..proj4
retains the original string input to crs, and.epsg
retains a valid integer parsed from the crs input.This PR adds tests for
flopy.utils.mfreadnam.attribs_from_namfile_header
and checks the same simulations withModflow.load
to inspect a few modelgrid properties. This PR was also tested locally without pyproj.