-
Notifications
You must be signed in to change notification settings - Fork 92
Support to bridges with external sets/functions #490
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
Codecov Report
@@ Coverage Diff @@
## master #490 +/- ##
=========================================
- Coverage 95.38% 94.3% -1.09%
=========================================
Files 46 46
Lines 4681 4738 +57
=========================================
+ Hits 4465 4468 +3
- Misses 216 270 +54
Continue to review full report at Codecov.
|
@@ -410,14 +410,31 @@ _mod(m::Module, s::Symbol) = Expr(:., m, :($(QuoteNode(s)))) | |||
# (:Zeros) -> :(MOI.Zeros) | |||
_moi(s::Symbol) = _mod(MOI, s) |
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.
Why not simply removing this function and force the user to write
@model LPModel () (MOI.EqualTo, MOI.GreaterThan, MOI.LessThan, MOI.Interval) (MOI.Zeros, MOI.Nonnegatives, MOI.Nonpositives) () (MOI.SingleVariable,) (MOI.ScalarAffineFunction,) (MOI.VectorOfVariables,) (MOI.VectorAffineFunction,)
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.
The @model might be called within the definition of module NewModule
in which case you can't pass NewModule.NewSet
for example. Can you?
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.
If you remove this _moi function and all calls to it then it should work
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.
FWIW the escaping/scoping rules for macros changed between 0.6 and 0.7. You might run into this.
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.
Forcing the module prefix sounds like the most robust way to go.
replaced by #510 |
It is working for what I needed but I'd consider the PR as a WIP. There are still two issues mainly: