Open albertkklam opened 2 years ago
Here is a list of some of the changes that need to be applied:
Ipopt.Optimizer
replaces IpoptSolver
(see https://github.com/jump-dev/Ipopt.jl)@variable(;base_name=...)
replaces @variable(;basename=...)
(see https://jump.dev/JuMP.jl/stable/manual/variables/#Variable-names)@constraintref
and registercon()
are now obsolete (see https://jump.dev/JuMP.jl/stable/manual/constraints/)registerobject()
is now obsoletevalue()
replaces getvalue()
in most cases (see https://jump.dev/JuMP.jl/stable/reference/solutions/#Primal-solutions)dual()
replaces getdual()
(see https://jump.dev/JuMP.jl/stable/reference/solutions/#Dual-solutions)set_lower[upper]_bound()
replaces setlower[upper]bound()
(see https://jump.dev/JuMP.jl/stable/reference/variables/)set_start_value()
replaces setvalue()
(see https://jump.dev/JuMP.jl/stable/reference/variables/)objective_value()
replaces getobjectivevalue()
(see https://jump.dev/JuMP.jl/stable/reference/solutions/#Basic-attributes)optimize!()
replaces solve()
(see https://jump.dev/JuMP.jl/stable/reference/solutions/)termination_status()
(or raw_status()
). status == MOI.LOCALLY_SOLVED
should replace status == :Optimal
(see https://jump.dev/MathOptInterface.jl/stable/manual/solutions/#Local-search-solvers and https://github.com/jump-dev/Ipopt.jl/blob/master/src/MOI_wrapper.jl#L1278)JuMP.num_constraints(;count_variable_in_set_constraints=false)
replaces MathProgBase.numconstr()
(see https://jump.dev/JuMP.jl/stable/reference/constraints/#JuMP.num_constraints)JuMP.num_variables()
replaces MathProgBase.numvar()
(see https://jump.dev/JuMP.jl/stable/reference/variables/#JuMP.num_variables)MathOptInterface.initialize()
replaces MathProgBase.initialize()
(see https://jump.dev/JuMP.jl/stable/manual/nlp/#Querying-derivatives-from-a-JuMP-model and https://jump.dev/MathOptInterface.jl/stable/reference/nonlinear/#Functions)MathOptInterface.eval_constraint()
replaces MathProgBase.eval_g()
(see https://jump.dev/MathOptInterface.jl/stable/reference/nonlinear/#Functions)DenseAxisArray.data
replaces DenseAxisArray.innerArray
(see https://jump.dev/JuMP.jl/stable/manual/containers/#DenseAxisArray)Breaking changes from v0.18 to v0.19 can be found in the Release Notes here: https://jump.dev/JuMP.jl/latest/release_notes/#Version-0.19.0-(February-15,-2019). A recommended workflow can be found here: https://jump.dev/JuMP.jl/stable/manual/solutions/#Recommended-workflow
Currently, we are limited to using Julia v1.5 because JuMP v0.18 does not compile in v1.6+. This has been raised previously in the JuMP repository (see https://github.com/jump-dev/JuMP.jl/issues/2438), and the conclusion from the developer team is that JuMP v0.18 is no longer supported and that all users should upgrade to the latest version of JuMP (see https://github.com/jump-dev/JuMP.jl/issues/2438#issuecomment-769371088).
However, JuMP v0.19 introduces a number of breaking changes (see https://discourse.julialang.org/t/mathoptinterface-and-upcoming-breaking-changes-in-jump-0-19/4874), which more than likely will entail a substantial rework of the JuMP portions of OPF. For consistency, upgrading OPF to use JuMP v0.19+ should also be done in parallel with upgrading KMC to use the same JuMP version, and that likely will also require substantial rework to the JuMP portions there. Additionally, JuMP v0.19+ may make parts, if not all, of JuMPUtils redundant, which should become apparent as the relevant portions are upgraded.
We will get a better understanding of the amount of work required to do this upgrade by first isolating the portions of OPF that use JuMP and comparing these to the breaking changes in JuMP v0.19.