Skip to content

Commit aff15c5

Browse files
refactor: update OptimizationMOI to MTKv11
1 parent 4082506 commit aff15c5

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

lib/OptimizationMOI/Project.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@ name = "OptimizationMOI"
22
uuid = "fd9f6733-72f4-499f-8506-86b2bdd0dea1"
33
authors = ["Vaibhav Dixit <[email protected]> and contributors"]
44
version = "0.5.11"
5+
56
[deps]
67
OptimizationBase = "bca83a33-5cc9-4baa-983d-23429ab6bcbb"
78
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
89
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
910
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
10-
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
11+
ModelingToolkitBase = "7771a370-6774-4173-bd38-47e70ca0b839"
1112
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
1213
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
1314
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1415
SciMLStructures = "53ae85a6-f571-4167-b2af-e1d143709226"
1516
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
1617

18+
[weakdeps]
19+
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
20+
1721
[extras]
1822
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
1923
AmplNLWriter = "7c4d4715-977e-5154-bfe0-e096adeac482"
@@ -41,7 +45,8 @@ Ipopt = "1.10.4"
4145
NLopt = "1"
4246
SciMLBase = "2.122.1"
4347
SparseArrays = "1.6"
44-
ModelingToolkit = "10.23"
48+
ModelingToolkit = "11"
49+
ModelingToolkitBase = "1"
4550
SymbolicIndexingInterface = "0.3"
4651
julia = "1.10"
4752
Zygote = "0.6, 0.7"

lib/OptimizationMOI/src/OptimizationMOI.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ using SciMLBase
77
using SciMLStructures
88
using SymbolicIndexingInterface
99
using SparseArrays
10-
import ModelingToolkit: parameters, unknowns, varmap_to_vars, mergedefaults, toexpr
11-
import ModelingToolkit
12-
const MTK = ModelingToolkit
10+
import ModelingToolkitBase: parameters, unknowns, varmap_to_vars, mergedefaults, toexpr
11+
import ModelingToolkitBase
12+
const MTK = ModelingToolkitBase
1313
using Symbolics
1414
using LinearAlgebra
1515

@@ -217,20 +217,20 @@ function convert_to_expr(eq, expr_map; expand_expr = false)
217217
Symbolics.expand(eq)
218218
end
219219
end
220-
expr = ModelingToolkit.toexpr(eq)
220+
expr = ModelingToolkitBase.toexpr(eq)
221221

222222
expr = rep_pars_vals!(expr, expr_map)
223223
expr = symbolify!(expr)
224224
return expr
225225
end
226226

227227
function get_expr_map(sys)
228-
dvs = ModelingToolkit.unknowns(sys)
229-
ps = ModelingToolkit.parameters(sys)
228+
dvs = ModelingToolkitBase.unknowns(sys)
229+
ps = ModelingToolkitBase.parameters(sys)
230230
return vcat(
231-
[ModelingToolkit.toexpr(_s) => Expr(:ref, :x, i)
231+
[ModelingToolkitBase.toexpr(_s) => Expr(:ref, :x, i)
232232
for (i, _s) in enumerate(dvs)],
233-
[ModelingToolkit.toexpr(_p) => Expr(:ref, :p, i)
233+
[ModelingToolkitBase.toexpr(_p) => Expr(:ref, :p, i)
234234
for (i, _p) in enumerate(ps)])
235235
end
236236

0 commit comments

Comments
 (0)