Skip to content

Commit f7c5939

Browse files
committed
Fix isparameter to work in old case
1 parent 03d351e commit f7c5939

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/parameters.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ struct MTKParameterCtx end
33

44
function isparameter(x)
55
x = unwrap(x)
6-
if istree(x) && operation(x) isa Symbolic
6+
7+
#TODO: Delete this branch
8+
if x isa Symbolic && Symbolics.getparent(x, false) !== false
9+
p = Symbolics.getparent(x)
10+
isparameter(p) ||
11+
(hasmetadata(p, Symbolics.VariableSource) &&
12+
getmetadata(p, Symbolics.VariableSource)[1] == :parameters)
13+
elseif istree(x) && operation(x) isa Symbolic
714
getmetadata(x, MTKParameterCtx, false) ||
815
isparameter(operation(x))
916
elseif istree(x) && operation(x) == (getindex)

0 commit comments

Comments
 (0)