Skip to content
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(modelgrid): retain crs data from classic nam files #1904

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

mwtoews
Copy link
Contributor

@mwtoews mwtoews commented Aug 4, 2023

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.

  • With pyproj installed, the modelgrid properties .proj4 and .epsg are generated from the crs inputs.
  • Without pyproj installed, .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 with Modflow.load to inspect a few modelgrid properties. This PR was also tested locally without pyproj.

@mwtoews mwtoews force-pushed the fix-crs-info-from-namefile branch from 050b823 to b0e2a19 Compare August 4, 2023 01:37
@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Merging #1904 (b0e2a19) into develop (70b9a37) will increase coverage by 0.3%.
Report is 11 commits behind head on develop.
The diff coverage is 64.0%.

@@            Coverage Diff            @@
##           develop   #1904     +/-   ##
=========================================
+ Coverage     72.2%   72.6%   +0.3%     
=========================================
  Files          257     257             
  Lines        56488   56237    -251     
=========================================
+ Hits         40836   40840      +4     
+ Misses       15652   15397    -255     
Files Changed Coverage Δ
flopy/mbase.py 69.2% <50.0%> (-0.1%) ⬇️
flopy/discretization/grid.py 75.3% <60.0%> (+0.2%) ⬆️
flopy/modflow/mf.py 69.0% <100.0%> (+<0.1%) ⬆️
flopy/utils/mfreadnam.py 34.6% <100.0%> (+0.5%) ⬆️

... and 9 files with indirect coverage changes

@jdhughes-usgs jdhughes-usgs requested a review from aleaf August 6, 2023 16:06
Copy link
Contributor

@aleaf aleaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mwtoews thanks for submitting this. It will be good to have this functionality preserved for loading and locating older models with minimal effort.

@jdhughes-usgs jdhughes-usgs merged commit 99f680f into modflowpy:develop Aug 10, 2023
@mwtoews mwtoews deleted the fix-crs-info-from-namefile branch August 10, 2023 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants