From 4c0109f21d567c13aba2cbda1531d6b718b5a3bd Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Thu, 19 Sep 2024 12:01:40 -0400 Subject: [PATCH 1/2] Fix `calc_W` for W_transform refactor CI didn't catch this for some reason. --- test/utility_tests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/utility_tests.jl b/test/utility_tests.jl index 532a936b..50815468 100644 --- a/test/utility_tests.jl +++ b/test/utility_tests.jl @@ -17,7 +17,7 @@ using StochasticDiffEq.SciMLOperators: MatrixOperator jac=(u,p,t) -> A) prob = SDEProblem(fun, u0, tspan) integrator = init(prob, ImplicitEM(theta=1); adaptive=false, dt=dt) - W = calc_W(integrator, integrator.cache.nlsolver, dtgamma, #=repeat_step=#false, #=W_transform=#true) + W = calc_W(integrator, integrator.cache.nlsolver, dtgamma, #=repeat_step=#false) @test convert(AbstractMatrix, W) ≈ concrete_W @test W \ u0 ≈ concrete_W \ u0 @@ -29,7 +29,7 @@ using StochasticDiffEq.SciMLOperators: MatrixOperator prob = SDEProblem(fun, u0, tspan) integrator = init(prob, ImplicitEM(theta=1); adaptive=false, dt=dt) W = integrator.cache.nlsolver.cache.W - calc_W!(W, integrator, integrator.cache.nlsolver, integrator.cache, dtgamma, #=repeat_step=#false, #=W_transform=#true) + calc_W!(W, integrator, integrator.cache.nlsolver, integrator.cache, dtgamma, #=repeat_step=#false) # Did not update because it's an array operator # We don't want to build Jacobians when we have operators! From 2b3ec9cca8c3663bea498d0d21b10a05a0d46120 Mon Sep 17 00:00:00 2001 From: Oscar Smith Date: Thu, 19 Sep 2024 13:18:35 -0400 Subject: [PATCH 2/2] horrible nasty hack --- test/utility_tests.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/utility_tests.jl b/test/utility_tests.jl index 50815468..f55a48c3 100644 --- a/test/utility_tests.jl +++ b/test/utility_tests.jl @@ -1,7 +1,14 @@ using StochasticDiffEq, LinearAlgebra, SparseArrays, Random, LinearSolve, Test using StochasticDiffEq.OrdinaryDiffEq: WOperator, calc_W!, calc_W using StochasticDiffEq.SciMLOperators: MatrixOperator +using OrdinaryDiffEq +#horid nasty hack to deal with temporary calc_W refactor +# if there is a method that takes a W_transform argument, define the version that doesn't to set W_transform to true +if hasmethod(calc_W, (Any, Any, Any, Any, Any)) + OrdinaryDiffEq.calc_W(integ, nlsolver, dgamma, repeat_step::Bool) = OrdinaryDiffEq.calc_W(integ, nlsolver, dgamma, repeat_step, true) + OrdinaryDiffEq.calc_W!(integ, nlsolver, cache, dgamma, repeat_step::Bool) = OrdinaryDiffEq.calc_W(integ, nlsolver, dgamma, cacherepeat_step, true) +end @testset "Derivative Utilities" begin @testset "calc_W!" begin A = [-1.0 0.0; 0.0 -0.5]; σ = [0.9 0.0; 0.0 0.8]