Skip to content

Commit

Permalink
fix: use SII instead of explicitly accessing SciMLFunction.syms
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Nov 15, 2023
1 parent 24660c5 commit 5f2a24c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
TerminalLoggers = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"

[weakdeps]
Expand Down Expand Up @@ -51,6 +52,7 @@ ProgressLogging = "0.1"
Reexport = "0.2, 1.0"
Requires = "1.0"
SciMLBase = "1.79.0, 2"
SymbolicIndexingInterface = "0.3"
Symbolics = "5"
TerminalLoggers = "0.1"
julia = "1.6"
Expand Down
4 changes: 2 additions & 2 deletions lib/OptimizationMOI/src/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function SciMLBase.get_syms(sol::SciMLBase.OptimizationSolution{
C <:
MOIOptimizationNLPCache,
}
sol.cache.evaluator.f.syms
variable_symbols(sol.cache.evaluator.f)
end
function SciMLBase.get_paramsyms(sol::SciMLBase.OptimizationSolution{
T,
Expand All @@ -99,7 +99,7 @@ function SciMLBase.get_paramsyms(sol::SciMLBase.OptimizationSolution{
C <:
MOIOptimizationNLPCache,
}
sol.cache.evaluator.f.paramsyms
parameter_symbols(sol.cache.evaluator.f)
end

function MOIOptimizationNLPCache(prob::OptimizationProblem,
Expand Down
1 change: 1 addition & 0 deletions src/Optimization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ end

using Logging, ProgressLogging, ConsoleProgressMonitor, TerminalLoggers, LoggingExtras
using ArrayInterface, Base.Iterators, SparseArrays, LinearAlgebra
using SymbolicIndexingInterface
using Pkg

import SciMLBase: OptimizationProblem, OptimizationFunction, ObjSense,
Expand Down
4 changes: 2 additions & 2 deletions src/function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function instantiate_function(f, x, ::SciMLBase.NoAD,
cons_jac_prototype = cons_jac_prototype,
cons_hess_prototype = cons_hess_prototype,
expr = expr, cons_expr = cons_expr,
syms = f.syms, paramsyms = f.paramsyms,
sys = f.sys,
observed = f.observed)
end

Expand Down Expand Up @@ -97,7 +97,7 @@ function instantiate_function(f, cache::ReInitCache, ::SciMLBase.NoAD,
cons_jac_prototype = cons_jac_prototype,
cons_hess_prototype = cons_hess_prototype,
expr = expr, cons_expr = cons_expr,
syms = f.syms, paramsyms = f.paramsyms,
sys = f.sys,
observed = f.observed)
end

Expand Down

0 comments on commit 5f2a24c

Please sign in to comment.