diff --git a/src/solutions/save_idxs.jl b/src/solutions/save_idxs.jl index 6e4afbd33..7a2db44e6 100644 --- a/src/solutions/save_idxs.jl +++ b/src/solutions/save_idxs.jl @@ -44,12 +44,30 @@ function as_diffeq_array(vt::Vector{VectorTemplate}, t) return DiffEqArray(typeof(TupleOfArraysWrapper(vt))[], t, (1, 1)) end -function get_root_indp(indp) - if hasmethod(symbolic_container, Tuple{typeof(indp)}) && - (sc = symbolic_container(indp)) !== indp - return get_root_indp(sc) +function get_root_indp(prob::AbstractSciMLProblem) + get_root_indp(prob.f) +end + +function get_root_indp(f::T) where {T <: AbstractSciMLFunction} + if hasfield(T, :sys) + return f.sys + elseif hasfield(T, :f) && f.f isa AbstractSciMLFunction + return get_root_indp(f.f) + else + return nothing end - return indp +end + +function get_root_indp(prob::LinearProblem) + get_root_indp(prob.f) +end + +get_root_indp(prob::AbstractJumpProblem) = get_root_indp(prob.prob) + +get_root_indp(x) = x + +function get_root_indp(f::SymbolicLinearInterface) + get_root_indp(f.sys) end # Everything from this point on is public API diff --git a/test/downstream/comprehensive_indexing.jl b/test/downstream/comprehensive_indexing.jl index cd01bb4b4..41ac6135f 100644 --- a/test/downstream/comprehensive_indexing.jl +++ b/test/downstream/comprehensive_indexing.jl @@ -83,7 +83,7 @@ begin sint = init(sprob, ImplicitEM(); save_everystep = false) jint = init(jprob, SSAStepper()) nint = init(nprob, NewtonRaphson(); save_everystep = false) - @test_broken ssint = init(ssprob, DynamicSS(Tsit5()); save_everystep = false) # https://github.com/SciML/SteadyStateDiffEq.jl/issues/79 + ssint = init(ssprob, DynamicSS(Tsit5()); save_everystep = false) integrators = [oint, sint, jint, nint] integsystems = [osys, ssys, jsys, nsys] diff --git a/test/downstream/observables_autodiff.jl b/test/downstream/observables_autodiff.jl index 537a81bdb..222ca8e7f 100644 --- a/test/downstream/observables_autodiff.jl +++ b/test/downstream/observables_autodiff.jl @@ -5,6 +5,7 @@ import SymbolicIndexingInterface as SII import SciMLStructures as SS using ModelingToolkitStandardLibrary import ModelingToolkitStandardLibrary as MSL +using SciMLSensitivity @parameters σ ρ β @variables x(t) y(t) z(t) w(t) diff --git a/test/runtests.jl b/test/runtests.jl index 8ab4b657d..0b91d06c1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -95,8 +95,10 @@ end @time @safetestset "Integer idxs" begin include("downstream/integer_idxs.jl") end - @time @safetestset "Autodiff Remake" begin - include("downstream/remake_autodiff.jl") + if VERSION < v"1.12" # Zygote is incredibly broken on 1.12 + @time @safetestset "Autodiff Remake" begin + include("downstream/remake_autodiff.jl") + end end @time @safetestset "Partial Functions" begin include("downstream/partial_functions.jl") @@ -134,8 +136,10 @@ end @time @safetestset "Problem Indexing" begin include("downstream/problem_interface.jl") end - @time @safetestset "Adjoints" begin - include("downstream/adjoints.jl") + if VERSION < v"1.12" # Zygote is incredibly broken on 1.12 + @time @safetestset "Adjoints" begin + include("downstream/adjoints.jl") + end end @time @safetestset "ModelingToolkit Remake" begin include("downstream/modelingtoolkit_remake.jl")