diff --git a/Project.toml b/Project.toml index 034369e2..1be88ed0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BSeries" uuid = "ebb8d67c-85b4-416c-b05f-5f409e808f32" authors = ["Hendrik Ranocha and contributors"] -version = "0.1.58" +version = "0.1.59" [deps] Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" diff --git a/src/BSeries.jl b/src/BSeries.jl index 4b14668a..8fa023ea 100644 --- a/src/BSeries.jl +++ b/src/BSeries.jl @@ -769,7 +769,8 @@ function RootedTrees.elementary_weight(t::RootedTree, end # See Miyatake & Butcher (2016), p. 1998, right before eq. (2.8) -function derivative_weight(t::RootedTree, A_τζ, csrk::ContinuousStageRungeKuttaMethod) +function RootedTrees.derivative_weight(t::RootedTree, + A_τζ, csrk::ContinuousStageRungeKuttaMethod) # The derivative weight ϕ_τ is given as # ϕ_τ(t) = ∫₀¹ A_τζ ϕ_ζ(t₁) ... ϕ_ζ(tₘ) dζ diff --git a/test/runtests.jl b/test/runtests.jl index 11379e33..c6987a2e 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -20,6 +20,18 @@ using Aqua: Aqua @test exact == ExactSolution(exact) end + @testset "non-conflicting exports" begin + # classical RK4 + A = [0 0 0 0 + 1//2 0 0 0 + 0 1//2 0 0 + 0 0 1 0] + b = [1 // 6, 1 // 3, 1 // 3, 1 // 6] + rk = @inferred RungeKuttaMethod(A, b) + t = @inferred rootedtree([1, 2]) + @test_nowarn @inferred derivative_weight(t, rk) + end + @testset "latexify" begin # explicit midpoint method A = @SArray [0 0; 1//2 0] @@ -38,7 +50,7 @@ using Aqua: Aqua A = [0 0; 1/(2 * α) 0] b = [1 - α, α] c = [0, 1 / (2 * α)] - series_integrator = bseries(A, b, c, 3) + series_integrator = @inferred bseries(A, b, c, 3) @test_nowarn latexify(series_integrator) end @@ -46,11 +58,11 @@ using Aqua: Aqua A = [0 0; 1//2 0] b = [0, 1] c = [0, 1 // 2] - series_integrator = bseries(A, b, c, 1) + series_integrator = @inferred bseries(A, b, c, 1) @test_nowarn latexify(series_integrator) h = SymEngine.symbols("h") - coefficients = modified_equation(series_integrator) + coefficients = @inferred modified_equation(series_integrator) val1 = @test_nowarn latexify(coefficients, reduce_order_by = 1, cdot = false) val2 = @test_nowarn latexify(coefficients / h, cdot = false) @@ -78,11 +90,11 @@ using Aqua: Aqua A = [0 0; 1//2 0] b = [0, 1] c = [0, 1 // 2] - series_integrator = bseries(A, b, c, 1) + series_integrator = @inferred bseries(A, b, c, 1) @test_nowarn latexify(series_integrator) h = SymPy.symbols("h", real = true) - coefficients = modified_equation(series_integrator) + coefficients = @inferred modified_equation(series_integrator) val1 = @test_nowarn latexify(coefficients, reduce_order_by = 1, cdot = false) val2 = @test_nowarn latexify(coefficients / h, cdot = false) @@ -96,19 +108,22 @@ using Aqua: Aqua A = [0 0; 1/(2 * α) 0] b = [1 - α, α] c = [0, 1 / (2 * α)] - series_integrator = bseries(A, b, c, 3) - @test_nowarn latexify(series_integrator) + series_integrator = @inferred bseries(A, b, c, 3) + # Do not test warnings due to deprecation warnings from Symbolics + # see https://github.com/ranocha/BSeries.jl/pull/210 + # @test_nowarn latexify(series_integrator) + latexify(series_integrator) end @testset "Divide by h" begin A = [0 0; 1//2 0] b = [0, 1] c = [0, 1 // 2] - series_integrator = bseries(A, b, c, 1) + series_integrator = @inferred bseries(A, b, c, 1) @test_nowarn latexify(series_integrator) Symbolics.@variables h - coefficients = modified_equation(series_integrator) + coefficients = @inferred modified_equation(series_integrator) val1 = @test_nowarn latexify(coefficients, reduce_order_by = 1, cdot = false) val2 = @test_nowarn latexify(coefficients / h, cdot = false)