Closed pulsipher closed 7 months ago
This is just beautiful. What are your thoughts about changing the True/False
to all lowercase to match the true/false notation in Julia?
The failures are because of very subtle error on Linux with replace
that I cannot reproduce locally...
This is just beautiful. What are your thoughts about changing the
True/False
to all lowercase to match the true/false notation in Julia?
On one hand, lowercase would be consistent with Julia literals. On the other, uppercase would be consistent with the notation used in the GDP literature. In mind, printing should try to mimic the mathematical notation as close a possible.
If the tests don't pass, maybe just disable the printing tests...
This appears to explain the problem: https://discourse.julialang.org/t/replacing-multiple-strings-errors/13654
It appears weird things happen with multiple arguments in replace
when operating on a string.
That thread is quite old. It should work. I use replace on strings with multiple arguments regularly on Julia 1.9.
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
ccceb26
) 99.90% compared to head (84eeefc
) 99.90%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
That thread is quite old. It should work. I use replace on strings with multiple arguments regularly on Julia 1.9.
It seems the issue was only partly fixed and only works on certain versions of Julia and computer OSs. Using only 1 argument at a time fixes the problem. Another weird Julia bug :)
@pulsipher, I noticed that print(model)
doesn't include the nice printing for disjunctions. What needs to be done in order for this to work?
@pulsipher, I noticed that
print(model)
doesn't include the nice printing for disjunctions. What needs to be done in order for this to work?
See #101.
This closes #89.
Note that printing is different for Windows vs Linus/MacOS in that more unicode characters are used for the latter.
Let's demonstrate the printing using the model:
Disjunct Constraints
Here is what disjunct constraints look like for a Windows REPL.
Now for a Linux REPL:
Now in a Jupyter notebook for LaTeX printing:
Disjunctions
Let's make a disjunction to demonstrate:
Printing
d1
in a Windows REPL we get:In a Linux REPL we get:
In Jupyter we get:
Nested Disjunction
Now let's try a nested disjunction:
Printing
d1
in a Windows REPL we get:In a Linux REPL we get:
In Jupyter we get:
Logical Propositions
Let's try a logical proposition in a Windows REPL:
Now in a Linux REPL:
Now in Jupyter: Note that
Y[1]
is used instead ofY_{1}
, this is a JuMP issue: https://github.com/jump-dev/JuMP.jl/issues/3604Cardinality Constraints
Finally, let's look at cardinality constraints, starting with Windows (Linux is the same in this case):
Now in Jupyter: