Skip to content

Commit 3c42cc5

Browse files
Merge pull request #4659 from SciML/as/reversible-tfs-2
refactor: update MTK to reversible transformations API
2 parents ad64006 + e7cb53d commit 3c42cc5

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ Libdl = "1"
8585
LinearAlgebra = "1"
8686
LinearSolve = "3.66"
8787
Logging = "1"
88-
ModelingToolkitBase = "1.44"
88+
ModelingToolkitBase = "1.46"
8989
ModelingToolkitStandardLibrary = "2.20"
90-
ModelingToolkitTearing = "1.12.1"
90+
ModelingToolkitTearing = "1.16"
9191
Moshi = "0.3.6"
9292
NonlinearSolve = "4.3"
9393
OffsetArrays = "1.3.0"

lib/ModelingToolkitBase/test/dde.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using ModelingToolkitBase, DelayDiffEq, OrdinaryDiffEq, StaticArrays, Test
2+
import DiffEqNoiseProcess
23
using SymbolicIndexingInterface: is_markovian
34
using ModelingToolkitBase: t_nounits as t, D_nounits as D
45
using Setfield: @set!

src/problems/sccnonlinearproblem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ function calculate_op_from_u0_p(sys::System, u0::Union{Nothing, AbstractVector},
708708
end
709709
end
710710

711-
_ss = unhack_system(sys)
711+
_ss = MTKBase.reverse_all_default_reversible_transformations(sys)
712712
for eq in observed(_ss)
713713
write_possibly_indexed_array!(op, eq.lhs, eq.rhs, COMMON_NOTHING)
714714
end

test/structural_transformation/tearing.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,11 @@ end
279279
@test length(equations(sys3)) == 1
280280
@test isequal(only(unknowns(sys3)), sys3.capacitor.v)
281281

282-
idx = findfirst(isequal(sys3.resistor1.v), observables(sys3))
283-
rhs = observed(sys3)[idx].rhs
284-
@test operation(rhs) === getindex
285-
@test operation(arguments(rhs)[1]) === (\)
282+
idx = findfirst(observed(sys3)) do eq
283+
arr, isarr = ModelingToolkit.MTKBase.split_indexed_var(eq.rhs)
284+
isarr && iscall(arr) && operation(arr) === (\)
285+
end
286+
@test idx !== nothing
286287

287288
prob1 = ODEProblem(sys1, [], (0.0, 10.0); guesses = [sys1.resistor1.v => 1.0])
288289
prob2 = ODEProblem(sys2, [], (0.0, 10.0))

0 commit comments

Comments
 (0)