Update Xpress interfaces to support 9.5#3392
Conversation
| # Xpress 9.5.0 has new behavior for unbounded | ||
| # problems that have mipsols > 0. Previously | ||
| # getSolution() would return a solution, but now | ||
| # raises a ModelError (even though the deprecated | ||
| # getmipsol() will return a solution). We will try | ||
| # to fall back on the [deprecated] getmipsol(), but | ||
| # if it fails, we will raise the original exception. |
There was a problem hiding this comment.
Is this worth reporting to the Xpress folks? It seems like undesirable behavior, to say the least, and they may eventually remove getmipsol.
There was a problem hiding this comment.
Yes - it is, once we get our tests passing again. There were other changes that looked like compatibility issues until I got all the deprecation warnings silenced. (I have some evidence that other deprecation paths are not actually 100% backwards compatible).
There was a problem hiding this comment.
Just so that I understand correctly: you are saying that the MIPSOLS attribute returns a number greater than zero but still getSolution() raises an error?
There was a problem hiding this comment.
That is correct. It's probably an unintentional regression [and admittedly a pretty weird edge case that we happened to have a test case for] -- filing a bug report upstream is on our backlog (we are still working / fighting infrastructure to try and get a release out this week)
There was a problem hiding this comment.
Thanks. We confirm that this is a defect in the Xpress C library. We will work on it.
| opt.options['XSLP_SOLVER'] = 0 | ||
| # xpress 9.5.0 now defaults to trying (and failing) to solve this problem | ||
| # using the global solver. This option forces the use of the local solver. | ||
| opt.options['NLPSOLVER'] = 1 |
There was a problem hiding this comment.
This is most likely due to a change in the community license. The community license is the default license you get when you install Xpress via pip or conda and I suppose this is the license you are using for tests.
Pre 9.5 this license did not allow running the Xpress global solver. So Xpress did only aim for finding local optima here.
Starting with 9.5, the community license now allows using the global solver as well (with limits on the problem size). That is why Xpress now uses the global solver by default.
Fixes #3391 .
Summary/Motivation:
Xpress 9.5 was a disruptive release that introduced deprecation warnings and broke a number of tests. This PR builds on https://github.com/blnicho/pyomo/tree/xpress-9.5.0 and adds a compatibility shim to the underlying
xpressmodule to support both pre- and post-9.5 Xpress.Changes proposed in this PR:
xpresshasherdict and add ahasher.hashable()method to query / set the hashability for a given type.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: