Skip to content

Commit

Permalink
fixup! feat: add SII.observed support for AbstractSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed May 27, 2024
1 parent 7c3817e commit aa3f0ba
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,20 @@ function SymbolicIndexingInterface.is_observed(sys::AbstractSystem, sym)
end

function SymbolicIndexingInterface.observed(sys::AbstractSystem, sym)
return let _fn = build_explicit_observed_function(sys, sym)
fn(u, p, t) = _fn(u, p, t)
fn(u, p::MTKParameters, t) = _fn(u, p..., t)
fn
if is_time_dependent(sys)
return let _fn = build_explicit_observed_function(sys, sym)
fn1(u, p, t) = _fn(u, p, t)
fn1(u, p::MTKParameters, t) = _fn(u, p..., t)
fn1

Check warning on line 563 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L559-L563

Added lines #L559 - L563 were not covered by tests
end
else
return let _fn = build_explicit_observed_function(sys, sym)
fn2(u, p) = _fn(u, p)
fn2(u, p::MTKParameters) = _fn(u, p...)
fn2(::Nothing, p) = _fn([], p)
fn2(::Nothing, p::MTKParameters) = _fn([], p...)
fn2

Check warning on line 571 in src/systems/abstractsystem.jl

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L566-L571

Added lines #L566 - L571 were not covered by tests
end
end
end

Expand Down

0 comments on commit aa3f0ba

Please sign in to comment.