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

error msg more explicit wrt different interfaces #3141

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

lukasbiton
Copy link
Contributor

@lukasbiton lukasbiton commented Feb 16, 2024

Summary/Motivation:

As demonstrated in Issue 3130, the error message raised when a problem is unfeasible doesn't take into account the two different interfaces that can be used to create models: via contrib.appsi or via environ.SolverFactory.

Changes proposed in this PR:

For each of the appsi solvers, the error message raised now details the syntax more explicitly. The original issue was written using the HiGHS solver, but the following error message was added for Cbc, Cplex, Gurobi, Highs, Ipopt, and Wntr.

'A feasible solution was not found, so no solution can be loaded. '
'If using the appsi.solvers.Highs interface, you can '
'set opt.config.load_solution=False. If using the environ.SolverFactory '
'interface, you can set opt.solve(model, load_solutions = False). '
'Then you can check results.termination_condition and '
'results.best_feasible_objective before loading a solution.'

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

Copy link
Contributor

@michaelbynum michaelbynum 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! Looks great!

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (783872b) 88.33% compared to head (f7411c5) 88.33%.
Report is 50 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3141      +/-   ##
==========================================
- Coverage   88.33%   88.33%   -0.01%     
==========================================
  Files         833      833              
  Lines       92700    92700              
==========================================
- Hits        81889    81888       -1     
- Misses      10811    10812       +1     
Flag Coverage Δ
linux 86.23% <ø> (ø)
osx 75.72% <ø> (ø)
other 86.43% <ø> (-0.01%) ⬇️
win 83.66% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@blnicho blnicho merged commit 3b6cab9 into Pyomo:main Feb 21, 2024
33 checks passed
@lukasbiton lukasbiton deleted the explicit-unfeasible-error branch February 21, 2024 09:36
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.

4 participants