Skip to content

Commit e412c27

Browse files
Merge pull request #566 from AayushSabharwal/as/indexing-rework
refactor: add symbolic_type trait impl from SII
2 parents 9c72020 + 81f9f6e commit e412c27

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2121
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2222
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2323
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
24+
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
2425
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
2526
Unityper = "a7c27f48-0311-42f6-a7f8-2c11e75eb415"
2627

@@ -40,6 +41,7 @@ NaNMath = "0.3, 1"
4041
Setfield = "0.7, 0.8, 1"
4142
SpecialFunctions = "0.10, 1.0, 2"
4243
StaticArrays = "0.12, 1.0"
44+
SymbolicIndexingInterface = "0.3"
4345
TimerOutputs = "0.5"
4446
Unityper = "0.1.2"
4547
julia = "1.3"

src/SymbolicUtils.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ using Unityper
1313
using DataStructures
1414
using Setfield
1515
import Setfield: PropertyLens
16+
using SymbolicIndexingInterface
1617
import Base: +, -, *, /, //, \, ^, ImmutableDict
1718
using ConstructionBase
1819
include("interface.jl")

src/types.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ const EMPTY_DICT_T = typeof(EMPTY_DICT)
6161
end
6262
end
6363

64+
function SymbolicIndexingInterface.symbolic_type(::Type{<:BasicSymbolic})
65+
ScalarSymbolic()
66+
end
67+
6468
function exprtype(x::BasicSymbolic)
6569
@compactified x::BasicSymbolic begin
6670
Term => TERM

0 commit comments

Comments
 (0)