diff --git a/Project.toml b/Project.toml index cad0614..d929ecf 100644 --- a/Project.toml +++ b/Project.toml @@ -9,14 +9,17 @@ Manifolds = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e" ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb" [compat] +Aqua = "0.8" LinearAlgebra = "1.6" Manifolds = "0.10" ManifoldsBase = "0.15.16" +Test = "1.6" julia = "1.6" [extras] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" Manifolds = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Test", "Manifolds"] +test = ["Test", "Aqua", "Manifolds"] diff --git a/src/LieGroups.jl b/src/LieGroups.jl index 8722a45..1e45a8a 100644 --- a/src/LieGroups.jl +++ b/src/LieGroups.jl @@ -5,7 +5,7 @@ using ManifoldsBase, Manifolds, LinearAlgebra # # # = Compatibility (and a bit of type piracy for now) -# The following imports are necessary to use Manifolds.jl 0.10 with Lie Groups +# The following imports are necessary to use Manifolds.jl 0.10 with Lie groups # The line is removed when the Groups are removed from possibly 0.11 import Manifolds: apply, apply!, identity_element, is_identity, compose # Both define the following structs, so these for now lead to asking for explicit prefixes diff --git a/src/Lie_algebra/Lie_algebra_interface.jl b/src/Lie_algebra/Lie_algebra_interface.jl index 1cf67bb..67b1abd 100644 --- a/src/Lie_algebra/Lie_algebra_interface.jl +++ b/src/Lie_algebra/Lie_algebra_interface.jl @@ -65,6 +65,8 @@ end # Move this line already to ManifoldsBase? On Fibers of course. LinearAlgebra.norm(𝔤::LieAlgebra, X) = LinearAlgebra.norm(𝔤.manifold, 𝔤.point, X) +# Non-mutating case with single number -> avoid ambiguity +LinearAlgebra.norm(𝔤::LieAlgebra, X::Real) = LinearAlgebra.norm(𝔤.manifold, 𝔤.point, X) function LinearAlgebra.norm( G::LieGroup{𝔽,O}, ::Identity{O}, X ) where {𝔽,O<:AbstractGroupOperation} diff --git a/src/interface.jl b/src/interface.jl index c1f6682..2a3f1d5 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -547,17 +547,17 @@ function ManifoldsBase.isapprox( return ManifoldsBase.isapprox(G.manifold, identity_element(G), h; kwargs...) end function ManifoldsBase.isapprox( - G::LieGroup{𝔽,O}, g, h::Identity{O}; kwargs... + G::LieGroup{𝔽,O}, g, h::Identity{<:O}; kwargs... ) where {𝔽,O<:AbstractGroupOperation} return ManifoldsBase.isapprox(G.manifold, g, identity_element(G); kwargs...) end function ManifoldsBase.isapprox( - G::LieGroup{𝔽,O}, g::Identity{O}, h::Identity{O}; kwargs... + G::LieGroup{𝔽,O}, g::Identity{<:O}, h::Identity{<:O}; kwargs... ) where {𝔽,O<:AbstractGroupOperation} return true end function ManifoldsBase.isapprox( - G::LieGroup{𝔽,O}, g::Identity{O}, h::Identity{O2}; kwargs... + G::LieGroup{𝔽,O}, g::Identity{<:O}, h::Identity{<:O2}; kwargs... ) where {𝔽,O<:AbstractGroupOperation,O2<:AbstractGroupOperation} return false end diff --git a/test/LieGroupsTestSuite.jl/LieGroupsTestSuite.jl b/test/LieGroupsTestSuite.jl/LieGroupsTestSuite.jl index 2336dc1..b0b631c 100644 --- a/test/LieGroupsTestSuite.jl/LieGroupsTestSuite.jl +++ b/test/LieGroupsTestSuite.jl/LieGroupsTestSuite.jl @@ -591,7 +591,7 @@ function test_lie_group(G::LieGroup, properties::Dict, expectations::Dict=Dict() end """ - test_lie_group(G, properties, expectations) + test_group_action(G, properties, expectations) Test the Lie group ``G`` based on a `Dict` of properties and a `Dict` of `expectations @@ -615,7 +615,7 @@ Possible `expectations` are * `:manifold` is the `AbstractManifold` the action acts upon * `:repr` is a sting one gets from `repr(G)` """ -function test_GroupAction( +function test_group_action( A::AbstractGroupAction, properties::Dict, expectations::Dict=Dict() ) a_tol = get(expectations, :atol, 1e-8) @@ -668,5 +668,5 @@ function test_GroupAction( end end -export test_lie_group, test_GroupAction +export test_lie_group, test_group_action end # module diff --git a/test/groups/test_translation_group.jl b/test/groups/test_translation_group.jl index a4e50ac..a349918 100644 --- a/test/groups/test_translation_group.jl +++ b/test/groups/test_translation_group.jl @@ -61,7 +61,7 @@ begin A = GroupOperationAction(t, G) properties2[:Name] = "with $A" expectations2[:repr] = "GroupOperationAction($t, $G)" - test_GroupAction(A, properties2, expectations2) + test_group_action(A, properties2, expectations2) end end end diff --git a/test/runtests.jl b/test/runtests.jl index 3673b3d..21773ca 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -23,4 +23,5 @@ end @testset "Lie Groups" begin include_test("groups/test_translation_group.jl") end + include("test_aqua.jl") end diff --git a/test/test_aqua.jl b/test/test_aqua.jl new file mode 100644 index 0000000..e3d9e38 --- /dev/null +++ b/test/test_aqua.jl @@ -0,0 +1,8 @@ +using Aqua, LieGroups, Test + +@testset "Aqua.jl" begin + Aqua.test_all(LieGroups; ambiguities=(broken=false, exclude=[ + Base.:+, #ambiguities between Manifolds.Identity and LIeGroups.Identity + Base.:-, #ambiguities between Manifolds.Identity and LIeGroups.Identity + ])) +end