-
Notifications
You must be signed in to change notification settings - Fork 122
Support both MOI v0.9 and MOI v0.10 #468
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
Conversation
…19-579-03583683988
Codecov Report
@@ Coverage Diff @@
## master #468 +/- ##
==========================================
+ Coverage 91.82% 92.09% +0.27%
==========================================
Files 83 83
Lines 5137 5137
==========================================
+ Hits 4717 4731 +14
+ Misses 420 406 -14
Continue to review full report at Codecov.
|
odow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. If you want something that doesn't use try-catch, I think you should be able to use
if !isdefined(MOI, :SingleVariable) || MOI.SingleVariable isa Function
const SV_OR_VI, SV_OR_IDENTITY = MOI.VariableIndex, identity
else
const SV_OR_VI, SV_OR_IDENTITY = MOI.SingleVariable, MOI.VariableIndex
endCo-authored-by: Oscar Dowson <[email protected]>
|
Thanks, that's nicer! (The second branch should have |
Builds off of #467
I think we can support both MOI v0.9 and MOI v0.10 pretty easily, since there are so few changes we need to make. It's a bit hacky, but I think it is worth it, since there might be a long tail of solvers that aren't updated. E.g. dropping MBP support in Convex was pretty annoying for me personally (even though I was the one who did it) since I ended up wanting to use Pajarito, and this requires much less compat shimming than that would have.
I've updated CI here to test with both versions.