-
-
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
First pass of printing for MOI constraints. #1389
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1389 +/- ##
=========================================
+ Coverage 89.55% 89.8% +0.24%
=========================================
Files 25 25
Lines 3429 3541 +112
=========================================
+ Hits 3071 3180 +109
- Misses 358 361 +3
Continue to review full report at Codecov.
|
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.
LGTM, seems sensible starting point.
Some stuff like aff_string and quad_string really smells fishy looking at this - something for another day.
src/print.jl
Outdated
|
||
#------------------------------------------------------------------------ | ||
## Model | ||
#------------------------------------------------------------------------ | ||
function Base.show(io::IO, m::Model) # TODO temporary | ||
function Base.show(io::IO, model::Model) # TODO temporary |
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.
Nit: attach the TODO to the issue?
src/print.jl
Outdated
var_name = name(v) | ||
if !isempty(var_name) | ||
# TODO: This is wrong if variable name constains extra "]" | ||
return math(replace(replace(var_name,"[","_{",1),"]","}"), mathmode) | ||
return replace(replace(var_name,"[","_{",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.
Style: spaces between arguments.
Feels like I've untangled the printing rat's nest. JuMP
ConstraintRef
objects now print out the underlying constraint. There's obvious room for improvement, especially in how constraint sets print out (like, print fancy versions in IJulia). See the tests for example of what the print-out looks like. I also print the constraint name if it's non-empty.Does not yet resolve the issue #1180 because we need to decide what model printing should look like. Based on #957 we might want to print a summary by default and have another method to get the extensive-form print-out of the model.
@IainNZ, care to review since you did most of the original printing work?