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

feat(solvers): support for multiple solver types (#1706) #1709

Merged
merged 4 commits into from
Feb 15, 2023
Merged

feat(solvers): support for multiple solver types (#1706) #1709

merged 4 commits into from
Feb 15, 2023

Conversation

spaulins-usgs
Copy link
Contributor

Also included: fix(exe path): FloPy now correctly resolves relative paths to mf6 executable (#1633)

@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Merging #1709 (d38a59d) into develop (42eaad0) will decrease coverage by 0.1%.
The diff coverage is 68.6%.

@@            Coverage Diff            @@
##           develop   #1709     +/-   ##
=========================================
- Coverage     71.9%   71.9%   -0.1%     
=========================================
  Files          253     253             
  Lines        55890   55927     +37     
=========================================
+ Hits         40205   40227     +22     
- Misses       15685   15700     +15     
Impacted Files Coverage Δ
flopy/mf6/modflow/mfgwf.py 100.0% <ø> (ø)
flopy/mf6/modflow/mfgwt.py 76.0% <ø> (ø)
flopy/mf6/modflow/mfims.py 100.0% <ø> (ø)
flopy/mf6/utils/createpackages.py 7.1% <0.0%> (-0.4%) ⬇️
flopy/mf6/data/mfstructure.py 63.7% <50.0%> (-0.1%) ⬇️
flopy/mf6/modflow/mfsimulation.py 62.1% <76.8%> (+0.2%) ⬆️
flopy/utils/get_modflow.py 63.9% <0.0%> (-0.3%) ⬇️
flopy/export/utils.py 65.2% <0.0%> (-0.2%) ⬇️
flopy/modflow/mfflwob.py 84.5% <0.0%> (-0.1%) ⬇️
flopy/mf6/mfbase.py 82.1% <0.0%> (-0.1%) ⬇️
... and 17 more

Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

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

Thanks for this @spaulins-usgs. Couple of minor comments to think about.

Comment on lines 1022 to 1030
def register_ims_package(self, solution_file, model_list):
warnings.warn(
"register_ims_package() has been deprecated and will be "
"removed in version 3.3.7. Use "
"register_solution_package() instead.",
DeprecationWarning,
)
self.register_solution_package(solution_file, model_list)

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we want to deprecate this yet. Can we keep it for now, and reconsider when we officially release another solver type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@langevin-usgs, why not give the user as much warning as possible when a method will be deprecated? Are you thinking that you might come up with a better name than "register_solution_package" and don't want to commit to that name yet?

Copy link
Contributor

Choose a reason for hiding this comment

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

EMS is experimental now and while we're pretty sure it will come out at some point, it's premature to talk about deprecating existing options in order to support it. For the medium term, I don't see us having more than two types of solutions, so continuing to support register_ims_package() seems fine for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@langevin-usgs, deprecation warning removed

flopy/mbase.py Outdated
Comment on lines 1698 to 1729
exe = which(exe_name)
if exe is None:
if exe_name.lower().endswith(".exe"):
# try removing .exe suffix
exe = which(exe_name[:-4])
if exe is None:
# try abspath
exe = which(os.path.abspath(exe_name))
if exe is None:
raise Exception(
f"The program {exe_name} does not exist or is not executable."
)
if os.path.dirname(exe_name) == "":
exe = which(exe_name)
if exe is None:
if exe_name.lower().endswith(".exe"):
# try removing .exe suffix
exe = which(exe_name[:-4])
if exe is not None:
exe_name = exe_name[:-4]
if exe is None:
raise Exception(
f"The program {exe_name} does not exist or is not executable."
)
else:
if not silent:
print(
f"FloPy is using the following executable to run the "
f"model: {exe}"
)
else:
if not silent:
print(
f"FloPy is using the following executable to run the model: {exe}"
exe_name = os.path.abspath(exe_name)
if not os.path.exists(exe_name) and not os.path.exists(
f"{exe_name}.exe"
):
raise Exception(
f"The program {exe_name} does not exist or is not executable."
)
else:
if not silent:
print(
f"FloPy is using the following executable to run the "
f"model: {exe_name}"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's great to have this change, but I think we want this one as a separate PR. I understand that that it's easy to sneak it in here, but I think a separate PR is warranted in this case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@langevin-usgs, rolled back exe path feature for another PR

feat(solver support): rolling back ims deprecation warning
@langevin-usgs langevin-usgs merged commit ea04e83 into modflowpy:develop Feb 15, 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.

3 participants