We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents af4895e + 39c3708 commit 100d576Copy full SHA for 100d576
5 files changed
src/vector_of_array.jl
@@ -797,6 +797,15 @@ Base.@propagate_inbounds function Base.getindex(A::AbstractVectorOfArray, _arg,
797
end
798
symtype = symbolic_type(_arg)
799
elsymtype = symbolic_type(eltype(_arg))
800
+ # For symbolic indices, `A[sym, :]` is semantically equivalent to `A[sym]`
801
+ # (the no-args symbolic getindex already returns the full timeseries).
802
+ # Routing through the no-args path here also avoids a broadcast shape bug
803
+ # in SymbolicIndexingInterface's `GetStateIndex` when the underlying index
804
+ # is a `Vector{Int}` (array-symbolic) combined with a `Colon` time index.
805
+ if (symtype != NotSymbolic() || elsymtype != NotSymbolic()) &&
806
+ length(args) == 1 && args[1] === Colon()
807
+ return A[_arg]
808
+ end
809
810
return if symtype == NotSymbolic() && elsymtype == NotSymbolic()
811
if _arg isa Union{Tuple, AbstractArray} &&
test/downstream/Project.toml
@@ -4,7 +4,9 @@ ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
4
MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca"
5
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
6
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
7
+OrdinaryDiffEqRosenbrock = "43230ef6-c299-4910-a778-202eb28ce4ce"
8
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
9
+RecursiveArrayToolsShorthandConstructors = "39fb7555-b4ad-4efd-8abe-30331df017d3"
10
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
11
SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5"
12
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
@@ -18,6 +20,7 @@ ModelingToolkit = "8.33, 9, 10, 11"
18
20
MonteCarloMeasurements = "1.1"
19
21
NLsolve = "4"
22
OrdinaryDiffEq = "6.31, 7"
23
+OrdinaryDiffEqRosenbrock = "1, 2"
24
StaticArrays = "1"
25
SymbolicIndexingInterface = "0.3"
26
Tables = "1"
test/downstream/downstream_events.jl
@@ -1,4 +1,4 @@
1
-using OrdinaryDiffEq, StaticArrays, RecursiveArrayTools
+using OrdinaryDiffEq, StaticArrays, RecursiveArrayTools, RecursiveArrayToolsShorthandConstructors
2
u0 = AP[SVector{1}(50.0), SVector{1}(0.0)]
3
tspan = (0.0, 15.0)
test/downstream/odesolve.jl
@@ -1,4 +1,5 @@
-using OrdinaryDiffEq, NLsolve, RecursiveArrayTools, Test, ArrayInterface, StaticArrays
+using OrdinaryDiffEq, OrdinaryDiffEqRosenbrock, NLsolve, RecursiveArrayTools,
+ RecursiveArrayToolsShorthandConstructors, Test, ArrayInterface, StaticArrays
function lorenz(du, u, p, t)
du[1] = 10.0 * (u[2] - u[1])
du[2] = u[1] * (28.0 - u[3]) - u[2]
@@ -9,7 +10,7 @@ u0 = AP[[1.0, 0.0], [0.0]]
tspan = (0.0, 100.0)
prob = ODEProblem(lorenz, u0, tspan)
sol = solve(prob, Tsit5())
-sol = solve(prob, AutoTsit5(Rosenbrock23(autodiff = false)))
13
+sol = solve(prob, AutoTsit5(Rosenbrock23(autodiff = AutoFiniteDiff())))
14
sol = solve(prob, AutoTsit5(Rosenbrock23()))
15
16
@test all(Array(sol) .== sol)
@@ -72,4 +73,4 @@ end
72
73
u = fill(SVector{2}(ones(2)), 2, 3)
74
ode = ODEProblem(rhs!, VectorOfArray(u), (0.0, 1.0))
75
sol = solve(ode, Tsit5())
-@test SciMLBase.successful_retcode(sol)
76
+@test successful_retcode(sol)
test/downstream/symbol_indexing.jl
@@ -77,7 +77,7 @@ ts = 0:0.5:10
77
sol_ts = sol(ts)
78
@assert sol_ts isa DiffEqArray
79
test_tables_interface(
80
- sol_ts, [:timestamp, Symbol("x(t)"), Symbol("y(t)")],
+ sol_ts, [:timestamp; Symbol.(string.(unknowns(lv)))],
81
hcat(ts, Array(sol_ts)')
82
)
83
0 commit comments