Skip to content

Commit 828710f

Browse files
Merge pull request #585 from SciML/os/fix-ci
Fix `calc_W` for W_transform refactor
2 parents 870b882 + 2b3ec9c commit 828710f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test/utility_tests.jl

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
using StochasticDiffEq, LinearAlgebra, SparseArrays, Random, LinearSolve, Test
22
using StochasticDiffEq.OrdinaryDiffEq: WOperator, calc_W!, calc_W
33
using StochasticDiffEq.SciMLOperators: MatrixOperator
4+
using OrdinaryDiffEq
45

6+
#horid nasty hack to deal with temporary calc_W refactor
7+
# if there is a method that takes a W_transform argument, define the version that doesn't to set W_transform to true
8+
if hasmethod(calc_W, (Any, Any, Any, Any, Any))
9+
OrdinaryDiffEq.calc_W(integ, nlsolver, dgamma, repeat_step::Bool) = OrdinaryDiffEq.calc_W(integ, nlsolver, dgamma, repeat_step, true)
10+
OrdinaryDiffEq.calc_W!(integ, nlsolver, cache, dgamma, repeat_step::Bool) = OrdinaryDiffEq.calc_W(integ, nlsolver, dgamma, cacherepeat_step, true)
11+
end
512
@testset "Derivative Utilities" begin
613
@testset "calc_W!" begin
714
A = [-1.0 0.0; 0.0 -0.5]; σ = [0.9 0.0; 0.0 0.8]
@@ -17,7 +24,7 @@ using StochasticDiffEq.SciMLOperators: MatrixOperator
1724
jac=(u,p,t) -> A)
1825
prob = SDEProblem(fun, u0, tspan)
1926
integrator = init(prob, ImplicitEM(theta=1); adaptive=false, dt=dt)
20-
W = calc_W(integrator, integrator.cache.nlsolver, dtgamma, #=repeat_step=#false, #=W_transform=#true)
27+
W = calc_W(integrator, integrator.cache.nlsolver, dtgamma, #=repeat_step=#false)
2128
@test convert(AbstractMatrix, W) concrete_W
2229
@test W \ u0 concrete_W \ u0
2330

@@ -29,7 +36,7 @@ using StochasticDiffEq.SciMLOperators: MatrixOperator
2936
prob = SDEProblem(fun, u0, tspan)
3037
integrator = init(prob, ImplicitEM(theta=1); adaptive=false, dt=dt)
3138
W = integrator.cache.nlsolver.cache.W
32-
calc_W!(W, integrator, integrator.cache.nlsolver, integrator.cache, dtgamma, #=repeat_step=#false, #=W_transform=#true)
39+
calc_W!(W, integrator, integrator.cache.nlsolver, integrator.cache, dtgamma, #=repeat_step=#false)
3340

3441
# Did not update because it's an array operator
3542
# We don't want to build Jacobians when we have operators!

0 commit comments

Comments
 (0)