Skip to content
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
28 changes: 23 additions & 5 deletions src/solutions/save_idxs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/downstream/comprehensive_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
1 change: 1 addition & 0 deletions test/downstream/observables_autodiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 8 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
Loading