Skip to content

Commit

Permalink
fix: fix dumping of non-numeric variable metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Jul 23, 2024
1 parent 691c0cc commit 105bdbe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ ModelingToolkit.dump_variable_metadata(p)
function dump_variable_metadata(var)
uvar = unwrap(var)
vartype, name = get(uvar.metadata, VariableSource, (:unknown, :unknown))
shape = Symbolics.shape(var)
if shape == ()
type = symtype(uvar)
if type <: AbstractArray
shape = Symbolics.shape(var)
if shape == ()
shape = nothing
end
else
shape = nothing
end
unit = get(uvar.metadata, VariableUnit, nothing)
Expand Down

0 comments on commit 105bdbe

Please sign in to comment.