Skip to content

Commit 4c39175

Browse files
fix: search through filtered observed equations in build_function_wrapper
1 parent 884a0fb commit 4c39175

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/systems/codegen_utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ function build_function_wrapper(sys::AbstractSystem, expr, args...; p_start = 2,
149149
push!(cmap, c ~ getdefault(c))
150150
end
151151
# only get the necessary observed equations, avoiding extra computation
152-
if add_observed
153-
obsidxs = observed_equations_used_by(sys, expr)
152+
if add_observed && !isempty(obs)
153+
obsidxs = observed_equations_used_by(sys, expr; obs)
154154
else
155155
obsidxs = Int[]
156156
end

0 commit comments

Comments
 (0)