Skip to content

Commit

Permalink
Merge pull request #566 from AayushSabharwal/as/indexing-rework
Browse files Browse the repository at this point in the history
refactor: add symbolic_type trait impl from SII
  • Loading branch information
ChrisRackauckas authored Dec 11, 2023
2 parents 9c72020 + 81f9f6e commit e412c27
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"
Unityper = "a7c27f48-0311-42f6-a7f8-2c11e75eb415"

Expand All @@ -40,6 +41,7 @@ NaNMath = "0.3, 1"
Setfield = "0.7, 0.8, 1"
SpecialFunctions = "0.10, 1.0, 2"
StaticArrays = "0.12, 1.0"
SymbolicIndexingInterface = "0.3"
TimerOutputs = "0.5"
Unityper = "0.1.2"
julia = "1.3"
Expand Down
1 change: 1 addition & 0 deletions src/SymbolicUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ using Unityper
using DataStructures
using Setfield
import Setfield: PropertyLens
using SymbolicIndexingInterface
import Base: +, -, *, /, //, \, ^, ImmutableDict
using ConstructionBase
include("interface.jl")
Expand Down
4 changes: 4 additions & 0 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ const EMPTY_DICT_T = typeof(EMPTY_DICT)
end
end

function SymbolicIndexingInterface.symbolic_type(::Type{<:BasicSymbolic})
ScalarSymbolic()
end

function exprtype(x::BasicSymbolic)
@compactified x::BasicSymbolic begin
Term => TERM
Expand Down

0 comments on commit e412c27

Please sign in to comment.