Skip to content

Commit 83faba1

Browse files
fix: handle wrapped constants in dummy_derivative_graph
1 parent 9a3a0d6 commit 83faba1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/structural_transformation/partial_state_selection.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,12 @@ function dummy_derivative_graph!(
7777
# only accept small integers to avoid overflow
7878
is_all_small_int = all(_J) do x′
7979
x = unwrap(x′)
80+
SU.isconst(x) || return false
8081
x isa Number || return false
81-
isinteger(x) && typemin(Int8) <= x <= typemax(Int8)
82+
x = value(x)
83+
isinteger(x) && typemin(Int8) <= Int(x) <= typemax(Int8)
8284
end
83-
J = is_all_small_int ? Int.(unwrap.(_J)) : nothing
85+
J = is_all_small_int ? Int.(value.(_J)) : nothing
8486
end
8587
while true
8688
nrows = length(eqs)

0 commit comments

Comments
 (0)