From 201596c6e0711ff87090141bbc98465d42a677a7 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 17 Sep 2024 13:04:38 +0530 Subject: [PATCH] feat: improve `diff2term` for array symbolics --- src/utils.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index f2abd0cb7..2167bed06 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -131,8 +131,8 @@ function diff2term(O, O_metadata::Union{Dict, Nothing, Base.ImmutableDict}=nothi string(nameof(arguments(oldop)[1])) elseif oldop == getindex args = arguments(O) - opname = string(tosymbol(args[1]), "[", map(tosymbol, args[2:end])..., "]") - return Sym{symtype(O)}(Symbol(opname, d_separator, ds)) + opname = string(tosymbol(args[1])) + return metadata(Sym{symtype(args[1])}(Symbol(opname, d_separator, ds)), metadata(args[1]))[args[2:end]...] elseif oldop isa Function return nothing else