Closed hyrodium closed 1 year ago
Merging #257 (8700683) into master (d56bc26) will increase coverage by
0.32%
. The diff coverage is100.00%
.:exclamation: Current head 8700683 differs from pull request most recent head 486de18. Consider uploading reports for the commit 486de18 to get more accurate results
@@ Coverage Diff @@
## master #257 +/- ##
==========================================
+ Coverage 89.51% 89.84% +0.32%
==========================================
Files 15 17 +2
Lines 1593 1615 +22
==========================================
+ Hits 1426 1451 +25
+ Misses 167 164 -3
Impacted Files | Coverage Δ | |
---|---|---|
src/Rotations.jl | 100.00% <ø> (ø) |
|
src/unitquaternion.jl | 97.46% <ø> (-0.10%) |
:arrow_down: |
src/rotation_between.jl | 100.00% <100.00%> (ø) |
... and 2 files with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
What about making this helper function a new rotation type instead? Maybe a simple Between(u, v)
? That would avoid using the naming convention with underscore.
What about making this helper function a new rotation type instead? Maybe a simple Between(u, v)? That would avoid using the naming convention with underscore.
What's the benefit of the new type Between
?
The role of rotation_between
is similar to range
. These functions return various types which depend on their inputs.
julia> range(1,2,3)
1.0:0.5:2.0
julia> range(1,3)
1:3
julia> range(1,2,3) |> typeof
StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}
julia> range(1,3) |> typeof
UnitRange{Int64}
julia> rotation_between(SVector(1,2), SVector(2,1))
2×2 Angle2d{Float64} with indices SOneTo(2)×SOneTo(2)(-0.643501):
0.8 0.6
-0.6 0.8
julia> rotation_between(SVector(1,2,3), SVector(2,1,3))
3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(0.981981, 0.109109, 0.109109, -0.109109)):
0.952381 0.238095 0.190476
-0.190476 0.952381 -0.238095
-0.238095 0.190476 0.952381
julia> rotation_between(SVector(1,2), SVector(2,1)) |> typeof
Angle2d{Float64}
julia> rotation_between(SVector(1,2,3), SVector(2,1,3)) |> typeof
QuatRotation{Float64}
That would avoid using the naming convention with underscore.
Julia style guide, blue style, and sciml style recommend using snake_case
, so there's no problem with underscores.
Makes sense. Feel free to ignore the suggestion. Looking forward to seeing it merged.
Em dom., 14 de mai. de 2023 12:30, Yuto Horikawa @.***> escreveu:
What about making this helper function a new rotation type instead? Maybe a simple Between(u, v)? That would avoid using the naming convention with underscore.
What's the benefit of the new type Between? The role of rotation_between is similar to range. These functions return various types which depend on their inputs.
julia> range(1,2,3)1.0:0.5:2.0
julia> range(1,3)1:3
julia> range(1,2,3) |> typeof StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}
julia> range(1,3) |> typeof UnitRange{Int64}
julia> rotation_between(SVector(1,2), SVector(2,1))2×2 Angle2d{Float64} with indices SOneTo(2)×SOneTo(2)(-0.643501): 0.8 0.6 -0.6 0.8
julia> rotation_between(SVector(1,2,3), SVector(2,1,3))3×3 QuatRotation{Float64} with indices SOneTo(3)×SOneTo(3)(QuaternionF64(0.981981, 0.109109, 0.109109, -0.109109)): 0.952381 0.238095 0.190476 -0.190476 0.952381 -0.238095 -0.238095 0.190476 0.952381
julia> rotation_between(SVector(1,2), SVector(2,1)) |> typeof Angle2d{Float64}
julia> rotation_between(SVector(1,2,3), SVector(2,1,3)) |> typeof QuatRotation{Float64}
That would avoid using the naming convention with underscore.
Julia style guide https://docs.julialang.org/en/v1/manual/style-guide/, blue style https://github.com/invenia/BlueStyle, and sciml style https://github.com/SciML/SciMLStyle recommend using snake_case, so there's no problem with underscores.
— Reply to this email directly, view it on GitHub https://github.com/JuliaGeometry/Rotations.jl/pull/257#issuecomment-1546925430, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZQW3IMDBSIHRZ6M5IT6HDXGD3CBANCNFSM6AAAAAAXXEETEA . You are receiving this because you commented.Message ID: @.***>
This PR fixes https://github.com/JuliaGeometry/Rotations.jl/issues/256.