From 105bdbef84e84812e61423196c3cb8f52e5acd72 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 23 Jul 2024 17:35:13 +0530 Subject: [PATCH] fix: fix dumping of non-numeric variable metadata --- src/variables.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/variables.jl b/src/variables.jl index dc52269bff..6177748d9b 100644 --- a/src/variables.jl +++ b/src/variables.jl @@ -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)