-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Implement model printing #1646
Implement model printing #1646
Conversation
You've seen #1602 right? |
No I missed that. Fortunately, there is not too much intersection, most of the work of this PR was implementing |
Codecov Report
@@ Coverage Diff @@
## master #1646 +/- ##
==========================================
+ Coverage 90.51% 90.96% +0.45%
==========================================
Files 28 28
Lines 3805 4239 +434
==========================================
+ Hits 3444 3856 +412
- Misses 361 383 +22
Continue to review full report at Codecov.
|
io_test(REPLMode, model_1, """ | ||
Max a - b + 2 a1 - 10 x | ||
Subject to | ||
x $inset MathOptInterface.ZeroOne() |
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.
I think this should be printed as x binary
or something similar. Could be added now or left as a TODO.
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.
Moved to #1662
Solver name: No optimizer attached. | ||
Names registered in the model: b, c, c1, b1, a1, x, fi, z, u, a, y""", repl=:show) | ||
|
||
io_test(IJuliaMode, model_1, """ |
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.
Does this address #957? We don't want the detailed form to be the default printout in IJulia or at the repl.
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.
No, this can be done in a separate PR
test/print.jl
Outdated
@constraint(model_2, x*y <= 1) | ||
|
||
names_in_scope = Set([:x, :y]) | ||
# The order in which they appear varies between 32-bit and 64-bit |
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.
This is weird. What about sorting the list of names in the print function?
I have left two features as future work:
Closes #1180