Skip to content

Commit bcab934

Browse files
committed
plottable_indices dispatch
1 parent b4cd99b commit bcab934

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PoissonRandom = "0.4"
3838
RandomNumbers = "1.5"
3939
RecursiveArrayTools = "3.12"
4040
Reexport = "1.0"
41-
SciMLBase = "2.46"
41+
SciMLBase = "2.59"
4242
Setfield = "1"
4343
StaticArrays = "1.9"
4444
SymbolicIndexingInterface = "0.3.13"

src/extended_jump_array.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ function Base.similar(A::ExtendedJumpArray, ::Type{S},
9595
ExtendedJumpArray(similar(A.u, S), similar(A.jump_u, S))
9696
end
9797

98+
# plotting
99+
SciMLBase.plottable_indices(u::ExtendedJumpArray) = SciMLBase.plottable_indices(u.u)
100+
98101
# ODE norm to prevent type-unstable fallback
99102
@inline function DiffEqBase.ODE_DEFAULT_NORM(u::ExtendedJumpArray, t)
100103
Base.FastMath.sqrt_fast(real(sum(abs2, u)) / max(length(u), 1))

test/extended_jump_array.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Test, JumpProcesses, DiffEqBase, OrdinaryDiffEq
1+
using Test, JumpProcesses, DiffEqBase, OrdinaryDiffEq, SciMLBase
2+
using FastBroadcast
23
using StableRNGs
34

45
rng = StableRNG(123)
@@ -56,7 +57,6 @@ out_result .= bc_dtype_1 .+ bc_dtype_2 .* 2
5657
@test out_result result
5758

5859
# Test that fast broadcasting also gives the correct results
59-
using FastBroadcast
6060
@.. bc_out = 3.14 * bc_eja_1 + 2.7 * bc_eja_2
6161
@test bc_out 3.14 * bc_eja_1 + 2.7 * bc_eja_2
6262

@@ -118,4 +118,5 @@ let
118118
jprob = JumpProblem(oprob, Direct(), vrj, deathvrj)
119119
sol = solve(jprob, Tsit5())
120120
@test eltype(sol.u) <: ExtendedJumpArray{Float64, 1, Vector{Float64}, Vector{Float64}}
121+
@test SciMLBase.plottable_indices(sol.u[1]) == 1:length(u₀)
121122
end

0 commit comments

Comments
 (0)