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 mean method for rotations #177

Merged
merged 1 commit into from
Nov 1, 2021

Conversation

hyrodium
Copy link
Collaborator

This PR fixes #91.

The Statistics.mean(::AbstractArray{<:Rotations}) method should return SMatrix. (cf. #91 (comment))
I've just removed the current definition of the method mean(::AbstractArray{<:Rotations}).

Before this PR

julia> using Rotations, Statistics

julia> mean([RotX(i) for i in 1:3])
ERROR: UndefVarError: mean not defined
Stacktrace:
 [1] mean(vec::Vector{RotX{Float64}})
   @ Rotations ~/.julia/dev/Rotations/src/mean.jl:50
 [2] top-level scope
   @ REPL[2]:1

After this PR

julia> using Rotations, Statistics

julia> mean([RotX(i) for i in 1:3])
3×3 StaticArrays.SMatrix{3, 3, Float64, 9} with indices SOneTo(3)×SOneTo(3):
 1.0   0.0        0.0
 0.0  -0.288612  -0.630629
 0.0   0.630629  -0.288612

Note

I think the original method is useful if works fine, but the method should be renamed such as mean_rotation instead of Statistics.mean.
This should be fixed in other PR, and I haven't removed the original file src/mean.jl.

@codecov
Copy link

codecov bot commented Oct 31, 2021

Codecov Report

Merging #177 (829824b) into master (d34316c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #177   +/-   ##
=======================================
  Coverage   86.33%   86.33%           
=======================================
  Files          14       14           
  Lines        1325     1325           
=======================================
  Hits         1144     1144           
  Misses        181      181           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d34316c...829824b. Read the comment docs.

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.

Cannot take the mean of single or two axis euler rotations
2 participants