Skip to content

Commit 105bdbe

Browse files
fix: fix dumping of non-numeric variable metadata
1 parent 691c0cc commit 105bdbe

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/variables.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ ModelingToolkit.dump_variable_metadata(p)
3030
function dump_variable_metadata(var)
3131
uvar = unwrap(var)
3232
vartype, name = get(uvar.metadata, VariableSource, (:unknown, :unknown))
33-
shape = Symbolics.shape(var)
34-
if shape == ()
33+
type = symtype(uvar)
34+
if type <: AbstractArray
35+
shape = Symbolics.shape(var)
36+
if shape == ()
37+
shape = nothing
38+
end
39+
else
3540
shape = nothing
3641
end
3742
unit = get(uvar.metadata, VariableUnit, nothing)

0 commit comments

Comments
 (0)