From 8380d6b13887cc4af7287291aee515230e156e4e Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 13 Oct 2024 02:29:19 -0400 Subject: [PATCH 1/2] Backwards compatibility of scope detection for Catalyst Attempt to fix https://github.com/SciML/Catalyst.jl/issues/1075 --- src/utils.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.jl b/src/utils.jl index d38ab822d4..39d5d18ffd 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -492,6 +492,7 @@ recursively searches through all subsystems of `sys`, increasing the depth if it function collect_scoped_vars!(unknowns, parameters, sys, iv; depth = 1, op = Differential) if has_eqs(sys) for eq in get_eqs(sys) + hasfield(eq, :lhs) || continue eq.lhs isa Union{Symbolic, Number} || continue collect_vars!(unknowns, parameters, eq.lhs, iv; depth, op) collect_vars!(unknowns, parameters, eq.rhs, iv; depth, op) From d0014f62d6776b760e29a50ffc19582613127487 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 13 Oct 2024 03:33:32 -0400 Subject: [PATCH 2/2] Update src/utils.jl Co-authored-by: Sam Isaacson --- src/utils.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.jl b/src/utils.jl index 39d5d18ffd..e8ed131d78 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -492,7 +492,7 @@ recursively searches through all subsystems of `sys`, increasing the depth if it function collect_scoped_vars!(unknowns, parameters, sys, iv; depth = 1, op = Differential) if has_eqs(sys) for eq in get_eqs(sys) - hasfield(eq, :lhs) || continue + eq isa Equation || continue eq.lhs isa Union{Symbolic, Number} || continue collect_vars!(unknowns, parameters, eq.lhs, iv; depth, op) collect_vars!(unknowns, parameters, eq.rhs, iv; depth, op)