Skip to content
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

fix: use SII instead of explicitly accessing SciMLFunction.syms #626

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -61,6 +62,7 @@ ReverseDiff = "1"
SciMLBase = "1.79.0, 2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this need to be bumped?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it? Nothing in Optimization changed that prevents it from being compatible with previous versions of SciMLBase.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I thought the RAT v3 or SII v0.3 changes would require it, but if that back compatibility is kept then we're good.

SparseArrays = "1"
SparseDiffTools = "2"
SymbolicIndexingInterface = "0.3"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to not get resolved

Copy link
Member Author

@AayushSabharwal AayushSabharwal Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not released yet
SciML/SymbolicIndexingInterface.jl#12

The changes here are due to SciML/SciMLBase.jl#532

Symbolics = "5"
TerminalLoggers = "0.1"
Tracker = "0.2"
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't OptimizationMOI need its Project.toml updated?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump on this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't realize. Thanks. I'll push these changes to the rerun CI PR

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
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ComponentArrays = ">= 0.13.9"
DiffEqFlux = ">= 2"
Enzyme = ">= 0.11.0"
FiniteDiff = ">= 2.8.1"
Flux = "0.13"
Flux = "0.13, 0.14"
ForwardDiff = ">= 0.10.19"
IterTools = ">= 1.3.0"
Lux = ">= 0.4.50"
Expand Down
Loading