Skip to content

Commit

Permalink
fix: fix SII.observed for time-independent systems
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed May 29, 2024
1 parent ccfed66 commit f217bd3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/systems/abstractsystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -495,10 +495,18 @@ 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)
fn(u, p, t) = _fn(u, p, t)
fn(u, p::MTKParameters, t) = _fn(u, p..., t)
fn

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

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L498-L502

Added lines #L498 - L502 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

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

View check run for this annotation

Codecov / codecov/patch

src/systems/abstractsystem.jl#L505-L508

Added lines #L505 - L508 were not covered by tests
end
end
end

Expand Down

0 comments on commit f217bd3

Please sign in to comment.