Skip to content

Commit

Permalink
fix conflicting exports (#210)
Browse files Browse the repository at this point in the history
* fix conflicting exports

* format

* format

* do not fail for deprecation warnings of Symbolics
  • Loading branch information
ranocha committed Jun 10, 2024
1 parent 920c949 commit 9ca28d1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BSeries"
uuid = "ebb8d67c-85b4-416c-b05f-5f409e808f32"
authors = ["Hendrik Ranocha <mail@ranocha.de> and contributors"]
version = "0.1.58"
version = "0.1.59"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down
3 changes: 2 additions & 1 deletion src/BSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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ζ
Expand Down
33 changes: 24 additions & 9 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -38,19 +50,19 @@ 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

@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)

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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down

2 comments on commit 9ca28d1

@ranocha
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/108618

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.59 -m "<description of version>" 9ca28d1520f3b3cd35566b5a80b1cb4eac481cd0
git push origin v0.1.59

Please sign in to comment.