Skip to content

Commit 6c2f390

Browse files
Use interface defined in SymbolicIndexingInterface
- `symbolic_indexing_interface.jl` moved to its own package - Update tests accordingly
1 parent 69f70a7 commit 6c2f390

File tree

4 files changed

+3
-114
lines changed

4 files changed

+3
-114
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1616
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
1717
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
1818
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
19+
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
1920
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
2021
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"
2122

@@ -30,6 +31,7 @@ GPUArraysCore = "0.1"
3031
IteratorInterfaceExtensions = "1"
3132
RecipesBase = "0.7, 0.8, 1.0"
3233
StaticArraysCore = "1.1"
34+
SymbolicIndexingInterface = "0.1"
3335
Tables = "1"
3436
ZygoteRules = "0.2"
3537
julia = "1.6"

src/RecursiveArrayTools.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module RecursiveArrayTools
77
using DocStringExtensions
88
using RecipesBase, StaticArraysCore, Statistics,
99
ArrayInterfaceCore, LinearAlgebra
10+
using SymbolicIndexingInterface
1011

1112
import ChainRulesCore
1213
import ChainRulesCore: NoTangent
@@ -37,9 +38,6 @@ import GPUArraysCore
3738
Base.convert(T::Type{<:GPUArraysCore.AbstractGPUArray}, VA::AbstractVectorOfArray) = T(VA)
3839
ChainRulesCore.rrule(T::Type{<:GPUArraysCore.AbstractGPUArray}, xs::AbstractVectorOfArray) = T(xs), ȳ -> (NoTangent(),ȳ)
3940

40-
export independent_variables, is_indep_sym, states, state_sym_to_index, is_state_sym,
41-
parameters, param_sym_to_index, is_param_sym, SymbolCache
42-
4341
export VectorOfArray, DiffEqArray, AbstractVectorOfArray, AbstractDiffEqArray,
4442
AllObserved, vecarr_to_arr, vecarr_to_vectors, tuples
4543

src/symbolic_indexing_interface.jl

Lines changed: 0 additions & 84 deletions
This file was deleted.

test/symbolic_indexing_interface_test.jl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,5 @@
11
using RecursiveArrayTools, Test
22

3-
sc = SymbolCache(nothing, nothing, nothing)
4-
@test isempty(independent_variables(sc))
5-
@test !is_indep_sym(sc, :a)
6-
@test isempty(states(sc))
7-
@test isnothing(state_sym_to_index(sc, :a))
8-
@test !is_state_sym(sc, :a)
9-
@test isempty(parameters(sc))
10-
@test isnothing(param_sym_to_index(sc, :a))
11-
@test !is_param_sym(sc, :a)
12-
13-
sc = SymbolCache([:a, :b], [:t], [:c, :d])
14-
@test independent_variables(sc) == [:t]
15-
@test is_indep_sym(sc, :t)
16-
@test !is_indep_sym(sc, :a)
17-
@test states(sc) == [:a, :b]
18-
@test state_sym_to_index(sc, :a) == 1
19-
@test state_sym_to_index(sc, :b) == 2
20-
@test isnothing(state_sym_to_index(sc, :t))
21-
@test all(is_state_sym.((sc,), [:a, :b]))
22-
@test !is_state_sym(sc, :c)
23-
@test parameters(sc) == [:c, :d]
24-
@test param_sym_to_index(sc, :c) == 1
25-
@test param_sym_to_index(sc, :d) == 2
26-
@test isnothing(param_sym_to_index(sc, :a))
27-
@test all(is_param_sym.((sc,), [:c, :d]))
28-
@test !is_param_sym(sc, :b)
29-
303
t = 0.0:0.1:1.0
314
f(x) = 2x
325
f2(x) = 3x

0 commit comments

Comments
 (0)