From 3c8fda80876e9639e2d7a8889ccb438bb3229963 Mon Sep 17 00:00:00 2001 From: Nathanael Bosch Date: Sat, 4 Nov 2023 16:05:34 +0100 Subject: [PATCH] Fix test issues --- src/algorithms.jl | 8 ++++---- test/state_init.jl | 6 +++--- test/stats.jl | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/algorithms.jl b/src/algorithms.jl index 966cb0247..08d42e19b 100644 --- a/src/algorithms.jl +++ b/src/algorithms.jl @@ -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.** @@ -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 @@ -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.** @@ -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}, diff --git a/test/state_init.jl b/test/state_init.jl index 9fe8be214..38e323a2c 100644 --- a/test/state_init.jl +++ b/test/state_init.jl @@ -34,12 +34,12 @@ 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...) @@ -47,7 +47,7 @@ import ODEProblemLibrary: prob_ode_fitzhughnagumo, prob_ode_pleiades @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 diff --git a/test/stats.jl b/test/stats.jl index e9ec43800..2362f5e1f 100644 --- a/test/stats.jl +++ b/test/stats.jl @@ -1,4 +1,5 @@ using ProbNumDiffEq +using OrdinaryDiffEq using Test using LinearAlgebra @@ -6,7 +7,7 @@ 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),