Skip to content

Commit

Permalink
Fix test issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanaelbosch committed Nov 4, 2023
1 parent 82db138 commit 3c8fda8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ abstract type AbstractEK <: OrdinaryDiffEq.OrdinaryDiffEqAdaptiveAlgorithm end
smooth=true,
prior=IWP(order),
diffusionmodel=DynamicDiffusion(),
initialization=TaylorModeInit())
initialization=TaylorModeInit(prior.num_derivatives))
**Gaussian ODE filter with zeroth-order vector field linearization.**
Expand Down Expand Up @@ -49,7 +49,7 @@ EK0(;
prior=IWP(order),
diffusionmodel=DynamicDiffusion(),
smooth=true,
initialization=TaylorModeInit(order),
initialization=TaylorModeInit(prior.num_derivatives),
) = EK0(prior, diffusionmodel, smooth, initialization)

_unwrap_val(::Val{B}) where {B} = B
Expand All @@ -60,7 +60,7 @@ _unwrap_val(B) = B
smooth=true,
prior=IWP(order),
diffusionmodel=DynamicDiffusion(),
initialization=TaylorModeInit(),
initialization=TaylorModeInit(prior.num_derivatives),
kwargs...)
**Gaussian ODE filter with first-order vector field linearization.**
Expand Down Expand Up @@ -103,7 +103,7 @@ EK1(;
prior::PT=IWP(order),
diffusionmodel::DT=DynamicDiffusion(),
smooth=true,
initialization::IT=TaylorModeInit(order),
initialization::IT=TaylorModeInit(prior.num_derivatives),
chunk_size=Val{0}(),
autodiff=Val{true}(),
diff_type=Val{:forward},
Expand Down
6 changes: 3 additions & 3 deletions test/state_init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ import ODEProblemLibrary: prob_ode_fitzhughnagumo, prob_ode_pleiades
prob = ODEProblem{true,true}(f!, u0, tspan)

@testset "`taylormode_get_derivatives`" begin
dfs = ProbNumDiffEq.taylormode_get_derivatives(
dfs = ProbNumDiffEq.get_derivatives(
TaylorModeInit(q),
prob.u0,
prob.f,
prob.p,
prob.tspan[1],
q,
)
@test length(dfs) == q + 1
@test true_init_states vcat(dfs...)
end

@testset "Taylormode: `initial_update!`" begin
integ = init(prob, EK0(order=q))
ProbNumDiffEq.initial_update!(integ, integ.cache, TaylorModeInit())
ProbNumDiffEq.initial_update!(integ, integ.cache, TaylorModeInit(q))
x = integ.cache.x
@test reshape(x.μ, :, 2)'[:] true_init_states
end
Expand Down
3 changes: 2 additions & 1 deletion test/stats.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using ProbNumDiffEq
using OrdinaryDiffEq
using Test
using LinearAlgebra

const q = 3

@testset "stats.nf testing $alg" for alg in (
EK0(prior=IWP(q), smooth=false),
EK0(prior=IWP(q), smooth=false, initialization=ClassicSolverInit()),
EK0(prior=IWP(q), smooth=false, initialization=ClassicSolverInit(alg=Tsit5())),
EK1(prior=IWP(q), smooth=false),
EK1(prior=IWP(q), smooth=false, autodiff=false),
EK1(prior=IOUP(q, -1), smooth=false),
Expand Down

0 comments on commit 3c8fda8

Please sign in to comment.