-
Notifications
You must be signed in to change notification settings - Fork 9
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 quadratic functionality #802
Conversation
f0c6678
to
fe1ef35
Compare
/format |
✔️ Auto-formatting triggered by this comment succeeded, commited as e966427 |
e966427
to
a985ffa
Compare
00e2f41
to
0bc99a2
Compare
0bc99a2
to
a2c121e
Compare
@stelmo if you could have a quick look now it would be great. I've set up proper intermediate (CT-based) functions for FBA/pFBA; same will follow with MOMA and FVA and likely later for others. These will also be used exclusively for the complex models. I split off the MOMA from QP tutorial. To be more realistic I assume we generally want to run pFBA instead of plain FBA to obtain a sane initial "reference" solution, right? |
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.
Small things
ctmodel; | ||
objective = ctmodel.:l2objective.value, | ||
optimizer = Clarabel.Optimizer, | ||
sense = Minimal, |
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 don't like this Minimal
. Since we are using JuMP's set_optimizer_attribute
etc., we should use JuMP's Min
and Max
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.
we're renaming JuMP's symbols to ours (people don't import them from JuMP!) so we shouldn't also force them to import parameters.
|
||
vt = C.constraint_values(ctmodel, J.value.(opt_model[:x])) # ConstraintTrees.jl is called C in COBREXA | ||
|
||
@test isapprox(vt.l2objective, ?; atol = QP_TEST_TOLERANCE) #src # TODO will break until mutable bounds |
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.
Can remove 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.
This is still commented out :D
|
||
vt = C.constraint_values(ctmodel, J.value.(opt_model[:x])) # ConstraintTrees.jl is called C in COBREXA | ||
|
||
@test isapprox(vt.l2objective, ?; atol = QP_TEST_TOLERANCE) #src # TODO will break until mutable bounds |
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.
Can remove TODO
Change the objective sense of optimization. Possible arguments are | ||
`JuMP.MAX_SENSE` and `JuMP.MIN_SENSE`. | ||
Change the objective sense of optimization. Accepted arguments include | ||
[`Minimal`](@ref), [`Maximal`](@ref), and [`Feasible`](@ref). |
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.
What does Feasible
do?
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.
|
||
Same as `JuMP.FEASIBILITY_SENSE`. | ||
""" | ||
const Feasible = J.FEASIBILITY_SENSE |
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.
Did not know this exists
|
||
""" | ||
Minimal | ||
|
||
Objective sense for finding the minimal value of the objective. | ||
|
||
Same as `JuMP.MIN_SENSE`. | ||
""" | ||
const Minimal = J.MIN_SENSE | ||
|
||
""" | ||
Maximal | ||
|
||
Objective sense for finding the maximal value of the objective. | ||
|
||
Same as `JuMP.MAX_SENSE`. | ||
""" | ||
const Maximal = J.MAX_SENSE | ||
|
||
""" | ||
Maximal | ||
|
||
Objective sense for finding the any feasible value of the objective. | ||
|
||
Same as `JuMP.FEASIBILITY_SENSE`. | ||
""" |
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.
My concern here is that it is just more stuff to remember. Can we not just re-export the JuMP constants?
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.
one can use the jump constants as well. I just don't want to 1] cause identifier collision 2] have folks to import jump all over again everytime they want to do something
Yep, it would make sense to use a pFBA solution for MOMA, but as long as its general i.e. the user can decide how sane they want to be, I don't mind |
I converted this to an admonition opportunity. |
No description provided.