-
Notifications
You must be signed in to change notification settings - Fork 525
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
[PEP] Redesign of Pyomo Solvers #1030
Comments
I think you should reduce the scope of this PEP. The third bullet point is an orthogonal and controversial issue. There is no need to have it possibly get in the way the other (much needed) changes. |
Regarding the third bullet Gabe references, can you clarify? Is said variable at least below the current block in the model component hierarchy? If it's not in the hierarchy, then I agree with Gabe that this is highly controversial. |
I updated the motivation in the pep to have numbers. It would be good to document the cases where "Bullet 3" is required. I also admit that the first time I heard that we needed to support solves where variables live outside the hierarchy, I thought this was very strange because it breaks encapsulation of sub-models. Having said that, I would like to see a use case where this is required to be convinced one way or another. |
@ghackebeil @jwatsonnm I will open a separate PEP for (3). |
@ghackebeil @jwatsonnm @carldlaird Let's move the discussion of (3) to #1032. |
Now that the controversy has moved to #1032, I predict that everyone will think the new PEP with only items one and two is non-controversial great idea and that you should proceed with your plan to create a couple of examples. |
I am adding a performance label to this PEP. I believe that a redesign of the base solver API is a prerequisite before we can (effectively) tackle things like reworking the writers / readers / persistent APIs. |
Archived on the master Performance Proposals Issue (#1430). Not closing as this is also marked as a PEP. |
It would be very useful to users to define one or more base protocols or base classes that all solvers inherit from. Many solvers like the BARON shell interface inherit from It would be best to factor out some standard behavior, like supporting the Also, for example, all solvers seem to implement a |
@alexchandel - Agreed. All of those considerations are on our list. |
I would add to this—because the "results" of a Pyomo solver are part of the solver's API—to standardize at least SOME of the In particular, indicate in universal fashion whether the result was a solution, or infeasible/failure. See #2942 for an example where this behavior is inconsistent between solvers, preventing universal client code from being written. |
I would add an additional motivation for base classes is the recent emergence of powerful Python type checkers like Pylance/Pyright and mypy. Unfortunately some of Pyomo is extremely dynamic, and currently difficult for type checkers to work out (e.g. #2078, #2821, #2938). However, it would be nice for the construction |
Additionally, the Pyomo solver interface needs a common exception for when a Solver is not available. Observe the extremely different behavior when calling solve() on two solvers, neither of which is available:
|
Linking to issue #728. It would be nice if this utility for extracting info from the Ipopt log could be incorporated into the redesigned Ipopt interface. |
Linking to issue #7 |
To do for Part 2:
|
I think the second bullet should be two different things:
|
Im really looking forward to this!!! |
I would like to start redesigning the solver interfaces in Pyomo.
Motivation
Preliminary Design Decisions (to be updated with time)
Implementation
Thoughts? Concerns?
Related Issues
mip.limits.solutions
parameter results inSolutionStatus.error
#1333symbolic_solver_labels
orload_solutions=False
#2218isv_key_support
forgurobi
#2401SolverFactory('gams', **kwds)
ignores keyword arguments #2757io_options
insolver.solve
keyword arguments. #2908The text was updated successfully, but these errors were encountered: