-
Notifications
You must be signed in to change notification settings - Fork 1
Refactor filenames and move some code around #36
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
base: main
Are you sure you want to change the base?
Conversation
import JuMP | ||
import MathOptInterface as MOI | ||
import ModelAnalyzer |
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 like alphabetical imports
model::JuMP.GenericModel; | ||
kwargs..., | ||
) where {T<:ModelAnalyzer.AbstractAnalyzer} |
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.
Don't use where
unless:
- it is needed in the body of the function
- its needed across multiple input arguments
- it's hard/impossible to write the method without it
return Interval(a.lo * x, a.hi * x) | ||
end | ||
return Interval(a.hi * x, a.lo * x) | ||
end |
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.
It's questionable that a very simple type like this and a few methods need a license attribution. Since both packages are MIT, we're in the clear, so I just moved into this file.
for t in f.terms | ||
out += _eval_variables(value_fn, t) | ||
end | ||
return out |
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.
Ditto here: why is this _eval_variales
needed?
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.
because MOI assumes the output type is the same as the ScalarAffineFunction (Float64), but we need the output to be an interval. JuMP does is correctly: #19 (comment)
I was thining about code organization. The printing stuff is very verbose so I was considering splitting the analysis files in two:
|
I should probably split this up, but let me comment in-line