Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove some ambiguities #236

Merged
merged 2 commits into from
Aug 8, 2022
Merged

Conversation

hyrodium
Copy link
Collaborator

@hyrodium hyrodium commented Aug 8, 2022

Before this PR

julia> using Rotations, Test

julia> detect_ambiguities(Rotations)
37-element Vector{Tuple{Method, Method}}:
 (RotY{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(gen::Base.Generator) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/SArray.jl:54)
 (RotX{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(gen::Base.Generator) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/SArray.jl:54)
 (Angle2dGenerator{T}(r) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/rotation_generator.jl:127, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)
 (RotX(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)
 (RotZ(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(gen::Base.Generator) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/SArray.jl:54)
 (Angle2dGenerator{T}(r) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/rotation_generator.jl:127, (::Type{SA})(gen::Base.Generator) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/SArray.jl:54)
 (RotX(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(a::AbstractArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:169)
 (RotZ(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)
 ((::Type{Q})(q::AbstractVector) where Q<:QuatRotation in Rotations at /home/hyrodium/.julia/dev/Rotations/src/unitquaternion.jl:73, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)
 (RotZ{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(gen::Base.Generator) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/SArray.jl:54)
 (RotY{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(a::AbstractArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:169)
 (RotY(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(a::AbstractArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:169)
 (RotY{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)
 (RotX{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)
 (RotX{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(a::AbstractArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:169)
 (RotY{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}, T, 2} where {N, M, T}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:126)
 (RotX{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}, T, 2} where {N, M, T}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:126)
 (RotY(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(gen::Base.Generator) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/SArray.jl:54)
 (RotY{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}} where {N, M}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:130)
 (RotZ(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(a::AbstractArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:169)
 (RotX(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}} where {N, M}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:130)
 (RotZ(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}} where {N, M}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:130)
 (Angle2dGenerator{T}(r) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/rotation_generator.jl:127, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}, T, 2} where {N, M, T}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:126)
 (RotZ{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}, T, 2} where {N, M, T}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:126)
 (RotZ{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}} where {N, M}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:130)
 (RotX(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}, T, 2} where {N, M, T}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:126)
 (RotY(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}, T, 2} where {N, M, T}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:126)
 (ones(::Type{R}, dims::Tuple{Vararg{Integer, N}}) where {R<:RotationGenerator, N} in Rotations at /home/hyrodium/.julia/dev/Rotations/src/rotation_generator.jl:24, ones(::Type{T}, dims::Tuple{}) where T in Base at array.jl:529)
 (RotZ(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}, T, 2} where {N, M, T}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:126)
 (Angle2dGenerator{T}(r) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/rotation_generator.jl:127, (::Type{SA})(a::AbstractArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:169)
 (RotY(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)
 (RotX(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SA})(gen::Base.Generator) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/SArray.jl:54)
 (RotY(theta) in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:21, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}} where {N, M}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:130)
 (RotZ{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)
 (Angle2dGenerator{T}(r) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/rotation_generator.jl:127, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}} where {N, M}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:130)
 (RotX{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SM})(I::LinearAlgebra.UniformScaling) where SM<:(StaticArraysCore.StaticArray{Tuple{N, M}} where {N, M}) in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/linalg.jl:130)
 (RotZ{T}(theta) where T in Rotations at /home/hyrodium/.julia/dev/Rotations/src/euler_types.jl:17, (::Type{SA})(a::AbstractArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:169)

After this PR

julia> using Rotations, Test

julia> detect_ambiguities(Rotations)
1-element Vector{Tuple{Method, Method}}:
 ((::Type{Q})(q::AbstractVector) where Q<:QuatRotation in Rotations at /home/hyrodium/.julia/dev/Rotations/src/unitquaternion.jl:73, (::Type{SA})(sa::StaticArraysCore.StaticArray) where SA<:StaticArraysCore.StaticArray in StaticArrays at /home/hyrodium/.julia/dev/StaticArrays/src/convert.jl:165)

@codecov
Copy link

codecov bot commented Aug 8, 2022

Codecov Report

Merging #236 (356927e) into master (524f61d) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
+ Coverage   88.70%   88.71%   +0.01%     
==========================================
  Files          16       16              
  Lines        1602     1604       +2     
==========================================
+ Hits         1421     1423       +2     
  Misses        181      181              
Impacted Files Coverage Δ
src/euler_types.jl 92.25% <100.00%> (ø)
src/rotation_generator.jl 96.40% <100.00%> (+0.02%) ⬆️
src/unitquaternion.jl 96.20% <100.00%> (+0.01%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

@hyrodium hyrodium merged commit 60a8ebd into JuliaGeometry:master Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant