Skip to content

Commit 812b353

Browse files
committed
Switch to CairoMakie, test interplay – currently still with “method overwritten” warnings
1 parent 9955472 commit 812b353

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[deps]
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
3+
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
34
DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78"
45
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
5-
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
77
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
88
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

test/numerical_checks.jl

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using ManifoldsBase, GLMakie, Plots, Statistics, Test
1+
using ManifoldsBase, Plots, Statistics, Test
22
# don't show plots actually
33
default(; show = false, reuse = true)
44

@@ -207,4 +207,38 @@ default(; show = false, reuse = true)
207207
X2[2:4] .= 2.0
208208
@test_throws ErrorException check_geodesic(M, q, X2; error = :error)
209209
end
210+
# Now load CairoMakie – default is Makie so we test the slope and geodesic again
211+
using CairoMakie
212+
@testset "Test retract checks" begin
213+
M = ManifoldsBase.Test.TestSphere(10)
214+
q = zeros(11)
215+
q[1] = 1.0
216+
p = zeros(11)
217+
p[1:4] .= 1 / sqrt(4)
218+
X = log(M, p, q)
219+
# One call with generating a plot
220+
f = check_retraction(M, ProjectionRetraction(), p, X; limits = (-2.5, 0.0), plot = true)
221+
@test f isa Figure
222+
# One call with generating a plot
223+
f2 = check_geodesic(M, p, X; plot = true)
224+
@test f2 isa CairoMakie.Figure
225+
end
226+
@testset "get/set plotting backend and that it actually switches back to Plots.jl" begin
227+
ManifoldsBase.set_plotting_backend!("Plots")
228+
@test ManifoldsBase.get_plotting_backend() == "Plots"
229+
230+
M = ManifoldsBase.Test.TestSphere(10)
231+
q = zeros(11)
232+
q[1] = 1.0
233+
p = zeros(11)
234+
p[1:4] .= 1 / sqrt(4)
235+
X = log(M, p, q)
236+
# One call with generating a plot
237+
f = check_retraction(M, ProjectionRetraction(), p, X; limits = (-2.5, 0.0), plot = true)
238+
@test f isa Plots.Plot
239+
# and back
240+
ManifoldsBase.set_plotting_backend!("Makie")
241+
f2 = check_retraction(M, ProjectionRetraction(), p, X; limits = (-2.5, 0.0), plot = true)
242+
@test f2 isa CairoMakie.Figure
243+
end
210244
end

0 commit comments

Comments
 (0)