diff --git a/Project.toml b/Project.toml index 88aad7ee..d352888f 100644 --- a/Project.toml +++ b/Project.toml @@ -15,6 +15,7 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df" StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5" +SymbolicsBase = "13454fcc-48b2-433e-829a-0418001dc7cb" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" [compat] @@ -27,6 +28,7 @@ RecipesBase = "0.7, 0.8, 1.0" Requires = "1.0" StaticArraysCore = "1.1" SymbolicIndexingInterface = "0.1, 0.2" +SymbolicsBase = "0.1.0" Tables = "1" Zygote = "0.6.56" julia = "1.6" diff --git a/src/RecursiveArrayTools.jl b/src/RecursiveArrayTools.jl index 51fa3b0a..482aa8f8 100644 --- a/src/RecursiveArrayTools.jl +++ b/src/RecursiveArrayTools.jl @@ -13,6 +13,10 @@ import Adapt import Tables, IteratorInterfaceExtensions +import SymbolicsBase: AllObserved, issymbollike +# Re-export from SymbolicsBase +export AllObserved + abstract type AbstractVectorOfArray{T, N, A} <: AbstractArray{T, N} end abstract type AbstractDiffEqArray{T, N, A} <: AbstractVectorOfArray{T, N, A} end @@ -38,7 +42,7 @@ import Requires end export VectorOfArray, DiffEqArray, AbstractVectorOfArray, AbstractDiffEqArray, - AllObserved, vecarr_to_vectors, tuples + vecarr_to_vectors, tuples export recursivecopy, recursivecopy!, recursivefill!, vecvecapply, copyat_or_push!, vecvec_to_mat, recursive_one, recursive_mean, recursive_bottom_eltype, diff --git a/src/vector_of_array.jl b/src/vector_of_array.jl index ab056e4d..be1159b3 100644 --- a/src/vector_of_array.jl +++ b/src/vector_of_array.jl @@ -61,18 +61,9 @@ mutable struct DiffEqArray{T, N, A, B, C, E, F} <: AbstractDiffEqArray{T, N, A} p::F end ### Abstract Interface -struct AllObserved -end Base.@pure __parameterless_type(T) = Base.typename(T).wrapper -@generated function issymbollike(x) - x <: Union{Symbol, AllObserved} && return true - ss = ["Operation", "Variable", "Sym", "Num", "Term"] - s = string(Symbol(__parameterless_type(x))) - any(x -> occursin(x, s), ss) -end - function Base.Array(VA::AbstractVectorOfArray{T, N, A}) where {T, N, A <: AbstractVector{ <:AbstractVector