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(BaseModel): don't suppress error if exe not found #1901

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

wpbonelli
Copy link
Member

close #1896

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #1901 (8e0ad42) into develop (ca838b1) will increase coverage by 1.7%.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##           develop   #1901     +/-   ##
=========================================
+ Coverage     70.8%   72.6%   +1.7%     
=========================================
  Files          257     257             
  Lines        56216   56216             
=========================================
+ Hits         39810   40817   +1007     
+ Misses       16406   15399   -1007     
Files Changed Coverage Δ
flopy/mbase.py 69.4% <100.0%> (+0.1%) ⬆️

... and 55 files with indirect coverage changes

@wpbonelli
Copy link
Member Author

wpbonelli commented Aug 3, 2023

MF6 autotests are failing here because some of them try to initialize Modflow models without specifying an exe. Previously failures to resolve the default exe mf2005 were suppressed on model init/load.

I see two options:

  1. Require a valid exe at init and/or load time. If we go with this, this PR is ready as is, but mf6 autotests need a fix.
  2. Defer exe resolution until run_model(). It may be nice to allow loading without specifying an exe, e.g. just to load a model, edit some settings, and rewrite input files. This PR will need changes, but mf6 autotests should not.

@langevin-usgs
Copy link
Contributor

@w-bonelli, what if we issue a warning at init/load time if the exe is not available, and issue an error in run_model if the exe is not available? The only potential problem is that there might be cases where the exe name is used to determine how to load a package or what options are supported.

@wpbonelli
Copy link
Member Author

Updated to warn on init/load, and error on run.

@wpbonelli wpbonelli merged commit c25c0b3 into modflowpy:develop Aug 7, 2023
@wpbonelli wpbonelli deleted the fix-mbase branch August 7, 2023 17:45
wpbonelli added a commit that referenced this pull request Aug 25, 2023
* warn at init/load time if exe not found, raise error at model run time
@wpbonelli wpbonelli mentioned this pull request Aug 25, 2023
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.

BaseModel uses mf2005 if specified exe is not found
2 participants