Skip to content

Commit 1ac273f

Browse files
fix: handle non-split systems in initial value promotion
1 parent 62b0b66 commit 1ac273f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/systems/nonlinear/initializesystem.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,9 @@ promote_type_with_nothing(::Type{T}, ::SizedVector{0}) where {T} = T
603603
function promote_type_with_nothing(::Type{T}, ::AbstractArray{T2}) where {T, T2}
604604
promote_type(T, T2)
605605
end
606+
function promote_type_with_nothing(::Type{T}, p::MTKParameters) where {T}
607+
promote_type_with_nothing(promote_type_with_nothing(T, p.tunable), p.initials)
608+
end
606609

607610
promote_with_nothing(::Type, ::Nothing) = nothing
608611
promote_with_nothing(::Type, x::SizedVector{0}) = x
@@ -628,8 +631,7 @@ end
628631
function promote_u0_p(u0, p, t0)
629632
T = Union{}
630633
T = promote_type_with_nothing(T, u0)
631-
T = promote_type_with_nothing(T, p.tunable)
632-
T = promote_type_with_nothing(T, p.initials)
634+
T = promote_type_with_nothing(T, p)
633635

634636
u0 = promote_with_nothing(T, u0)
635637
p = promote_with_nothing(T, p)

0 commit comments

Comments
 (0)