Skip to content

Commit 2efd9e1

Browse files
Merge pull request #2090 from SciML/arrayinterface
Update to ArrayInterface v7
2 parents 073e800 + a5f4e1e commit 2efd9e1

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version = "8.47.0"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
8-
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
8+
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
99
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
1010
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
1111
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
@@ -48,7 +48,7 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
4848

4949
[compat]
5050
AbstractTrees = "0.3, 0.4"
51-
ArrayInterfaceCore = "0.1.1"
51+
ArrayInterface = "6, 7"
5252
Combinatorics = "1"
5353
Compat = "3.42, 4"
5454
ConstructionBase = "1"

src/ModelingToolkit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using SciMLBase: StandardODEProblem, StandardNonlinearProblem, handle_varmap
1010
using Distributed
1111
using StaticArrays, LinearAlgebra, SparseArrays, LabelledArrays
1212
using InteractiveUtils
13-
using Latexify, Unitful, ArrayInterfaceCore
13+
using Latexify, Unitful, ArrayInterface
1414
using MacroTools
1515
@reexport using UnPack
1616
using Setfield, ConstructionBase

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ function DiffEqBase.ODEFunction{iip, specialize}(sys::AbstractODESystem, dvs = s
329329
elseif u0 === nothing || M === I
330330
M
331331
else
332-
ArrayInterfaceCore.restructure(u0 .* u0', M)
332+
ArrayInterface.restructure(u0 .* u0', M)
333333
end
334334

335335
obs = observed(sys)
@@ -548,7 +548,7 @@ function ODEFunctionExpr{iip}(sys::AbstractODESystem, dvs = states(sys),
548548
elseif u0 === nothing || M === I
549549
M
550550
else
551-
ArrayInterfaceCore.restructure(u0 .* u0', M)
551+
ArrayInterface.restructure(u0 .* u0', M)
552552
end
553553

554554
jp_expr = sparse ? :($similar($(get_jac(sys)[]), Float64)) : :nothing

src/systems/diffeqs/modelingtoolkitize.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ function modelingtoolkitize(prob::DiffEqBase.ODEProblem; kwargs...)
1313

1414
_vars = define_vars(prob.u0, t)
1515

16-
vars = prob.u0 isa Number ? _vars : ArrayInterfaceCore.restructure(prob.u0, _vars)
16+
vars = prob.u0 isa Number ? _vars : ArrayInterface.restructure(prob.u0, _vars)
1717
params = if has_p
1818
_params = define_params(p)
1919
p isa Number ? _params[1] :
2020
(p isa Tuple || p isa NamedTuple || p isa AbstractDict ? _params :
21-
ArrayInterfaceCore.restructure(p, _params))
21+
ArrayInterface.restructure(p, _params))
2222
else
2323
[]
2424
end
@@ -43,7 +43,7 @@ function modelingtoolkitize(prob::DiffEqBase.ODEProblem; kwargs...)
4343
end
4444

4545
if DiffEqBase.isinplace(prob)
46-
rhs = ArrayInterfaceCore.restructure(prob.u0, similar(vars, Num))
46+
rhs = ArrayInterface.restructure(prob.u0, similar(vars, Num))
4747
fill!(rhs, 0)
4848
if prob.f isa ODEFunction &&
4949
prob.f.f isa FunctionWrappersWrappers.FunctionWrappersWrapper
@@ -168,12 +168,12 @@ function modelingtoolkitize(prob::DiffEqBase.SDEProblem; kwargs...)
168168

169169
_vars = define_vars(prob.u0, t)
170170

171-
vars = prob.u0 isa Number ? _vars : ArrayInterfaceCore.restructure(prob.u0, _vars)
171+
vars = prob.u0 isa Number ? _vars : ArrayInterface.restructure(prob.u0, _vars)
172172
params = if has_p
173173
_params = define_params(p)
174174
p isa Number ? _params[1] :
175175
(p isa Tuple || p isa NamedTuple ? _params :
176-
ArrayInterfaceCore.restructure(p, _params))
176+
ArrayInterface.restructure(p, _params))
177177
else
178178
[]
179179
end

src/systems/diffeqs/sdesystem.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ function DiffEqBase.SDEFunction{iip}(sys::SDESystem, dvs = states(sys),
436436
end
437437

438438
M = calculate_massmatrix(sys)
439-
_M = (u0 === nothing || M == I) ? M : ArrayInterfaceCore.restructure(u0 .* u0', M)
439+
_M = (u0 === nothing || M == I) ? M : ArrayInterface.restructure(u0 .* u0', M)
440440

441441
obs = observed(sys)
442442
observedfun = let sys = sys, dict = Dict()
@@ -527,7 +527,7 @@ function SDEFunctionExpr{iip}(sys::SDESystem, dvs = states(sys),
527527

528528
M = calculate_massmatrix(sys)
529529

530-
_M = (u0 === nothing || M == I) ? M : ArrayInterfaceCore.restructure(u0 .* u0', M)
530+
_M = (u0 === nothing || M == I) ? M : ArrayInterface.restructure(u0 .* u0', M)
531531

532532
ex = quote
533533
f = $f

src/systems/nonlinear/modelingtoolkitize.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ function modelingtoolkitize(prob::NonlinearProblem; kwargs...)
99

1010
_vars = reshape([variable(:x, i) for i in eachindex(prob.u0)], size(prob.u0))
1111

12-
vars = prob.u0 isa Number ? _vars : ArrayInterfaceCore.restructure(prob.u0, _vars)
12+
vars = prob.u0 isa Number ? _vars : ArrayInterface.restructure(prob.u0, _vars)
1313
params = if has_p
1414
_params = define_params(p)
1515
p isa Number ? _params[1] :
1616
(p isa Tuple || p isa NamedTuple ? _params :
17-
ArrayInterfaceCore.restructure(p, _params))
17+
ArrayInterface.restructure(p, _params))
1818
else
1919
[]
2020
end
2121

2222
if DiffEqBase.isinplace(prob)
23-
rhs = ArrayInterfaceCore.restructure(prob.u0, similar(vars, Num))
23+
rhs = ArrayInterface.restructure(prob.u0, similar(vars, Num))
2424
prob.f(rhs, vars, params)
2525
else
2626
rhs = prob.f(vars, params)

src/systems/optimization/modelingtoolkitize.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ function modelingtoolkitize(prob::DiffEqBase.OptimizationProblem; kwargs...)
1111
p = prob.p
1212
end
1313

14-
vars = ArrayInterfaceCore.restructure(prob.u0,
14+
vars = ArrayInterface.restructure(prob.u0,
1515
[variable(:x, i) for i in eachindex(prob.u0)])
1616
params = p isa DiffEqBase.NullParameters ? [] :
17-
ArrayInterfaceCore.restructure(p, [variable(, i) for i in eachindex(p)])
17+
ArrayInterface.restructure(p, [variable(, i) for i in eachindex(p)])
1818

1919
eqs = prob.f(vars, params)
2020

0 commit comments

Comments
 (0)