Skip to content

Commit c55c6c4

Browse files
fix: handle scalar cost in default_consolidate
1 parent 8c652af commit c55c6c4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/systems/system.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ struct System <: AbstractSystem
7676
end
7777

7878
function default_consolidate(costs, subcosts)
79+
if !(costs isa Union{AbstractArray, Symbolic{<:AbstractArray}})
80+
costs = (costs,)
81+
end
7982
return sum(costs; init = 0.0) + sum(subcosts; init = 0.0)
8083
end
8184

0 commit comments

Comments
 (0)