Skip to content

Commit a51ba6b

Browse files
authored
Merge pull request #1845 from SciML/baggepinnen-patch-1
Make the find/replace work for all use cases with AnalysisPoint
2 parents 9c2a392 + 0cae80e commit a51ba6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/systems/connectors.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,14 @@ function generate_connection_set!(connectionsets, sys::AbstractSystem, find, rep
217217
for eq in eqs′
218218
lhs = eq.lhs
219219
rhs = eq.rhs
220-
if find !== nothing && find(rhs)
220+
if find !== nothing && find(rhs, namespace)
221221
neweq, extra_state = replace(rhs, namespace)
222222
if extra_state isa AbstractArray
223223
append!(extra_states, unwrap.(extra_state))
224-
else
225-
put!(extra_states, extra_state)
224+
elseif extra_state !== nothing
225+
push!(extra_states, extra_state)
226226
end
227-
push!(eqs, neweq)
227+
neweq isa AbstractArray ? append!(eqs, neweq) : push!(eqs, neweq)
228228
else
229229
if lhs isa Number || lhs isa Symbolic
230230
push!(eqs, eq) # split connections and equations

0 commit comments

Comments
 (0)