Xpress 9.9+ backward compatibility and other updates#701
Conversation
for more information, see https://pre-commit.ci
FabianHofmann
left a comment
There was a problem hiding this comment.
wonderful! thanks for being so quick! In the refactoring I could not test newer xpress versions and according to the docs the loadproblem should still be valid, but this is better!
some of our projects still rely on xpress 9.4 which is the lower bound of the compat range. would you mind checking this version as well?
|
|
||
| m = xpress.problem() | ||
| m.read(path_to_string(problem_fn)) | ||
| m.readProb(path_to_string(problem_fn)) |
There was a problem hiding this comment.
this is old xpress compatible?
Good points, thanks for the quick turnaround! Updated the PR with your suggestions. Tested on both 9.4 and 9.6 - all LP/MIP tests pass on both versions, all pre-9.8 fallbacks exercised correctly ( If you get any issues, or some other queries related to Xpress, feel free to reach out or tag me. Thank you for the nice work with the library :). |
|
What a responsiveness ;) thanks bruno, merging now |
Restore Xpress 9.9+ API backward compatibility and fix deprecation warnings
Closes # (if applicable).
Changes proposed in this Pull Request
Xpress 9.8 renamed several API methods (e.g.
loadproblem→loadLP/loadMIP/loadQP/loadMIQP,addnames→addNames,getDual→getDuals, etc.). PR #542 addedtry/except AttributeErrorwrappers to support both old and new API. These wrappers were inadvertently dropped in the Xpress direct-IO rewrite (787c4ce), reintroducing deprecation warnings when running against Xpress 9.9.This PR restores the wrappers across all affected call sites in:
loadLP,loadMIP,loadQP, orloadMIQPbased on problem type (integer variables / quadratic objective); falls back toloadproblemon Xpress < 9.8addNames()withaddnames()fallbackreadProb,readBasis,writeBasis,writeBinSolwith lowercase fallbackspostSolve,setLogFilewith lowercase fallbacksgetDuals()(was incorrectlygetDual())Checklist
doc.doc/release_notes.rstof the upcoming release is included.