Skip to content

Commit eebbf5b

Browse files
authored
Add deprecated warning to Octonion (#99)
* add deprecated warning to Octonion * update tests for deprecation of Octonion * bump version to v0.5.7 * update README.md to remove DualQuaternion and Octonion
1 parent 4cfb55d commit eebbf5b

File tree

4 files changed

+16
-45
lines changed

4 files changed

+16
-45
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Quaternions"
22
uuid = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0"
3-
version = "0.5.6"
3+
version = "0.5.7"
44

55
[deps]
66
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"

README.md

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -64,47 +64,5 @@ Implemented functions are:
6464
rand
6565
randn
6666

67-
[Dual quaternions](http://en.wikipedia.org/wiki/Dual_quaternion) are an extension, combining quaternions with
68-
[dual numbers](https://github.com/scidom/DualNumbers.jl).
69-
On top of just orientation, they can represent all rigid transformations.
70-
71-
There are two conjugation concepts here
72-
73-
conj (quaternion conjugation)
74-
dconj (dual conjugation)
75-
76-
further implemented here:
77-
78-
Q0 (the 'real' quaternion)
79-
Qe ( the 'dual' part)
80-
+-*/^
81-
abs
82-
abs2
83-
normalize
84-
normalizea
85-
angleaxis
86-
angle
87-
axis
88-
exp
89-
log
90-
sqrt
91-
rand
92-
93-
[Octonions](http://en.wikipedia.org/wiki/Octonion) form the logical next step on the Complex-Quaternion path.
94-
They play a role, for instance, in the mathematical foundation of String theory.
95-
96-
+-*/^
97-
real
98-
imag_part (tuple)
99-
conj
100-
abs
101-
abs2
102-
exp
103-
log
104-
normalize
105-
normalizea (return normalized octonion and absolute value as a tuple)
106-
exp
107-
log
108-
sqrt
109-
rand
110-
randn
67+
Currently, this package supports `DualQuaternion` and `Octonion` types, but these will be removed in the next breaking release.
68+
See https://github.com/JuliaGeometry/Quaternions.jl/issues/90 and https://github.com/JuliaGeometry/Quaternions.jl/pull/92 for more information.

src/Octonion.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ struct Octonion{T<:Real} <: Number
88
v6::T
99
v7::T
1010
norm::Bool
11+
function Octonion{T}(s,v1,v2,v3,v4,v5,v6,v7,norm) where T <: Real
12+
Base.depwarn("`Octonion` is deprecated and will be removed in the next breaking release. Use Octonions.jl package instead.", :Octonion)
13+
return new{T}(s,v1,v2,v3,v4,v5,v6,v7,norm)
14+
end
15+
end
16+
function Octonion(s::T,v1::T,v2::T,v3::T,v4::T,v5::T,v6::T,v7::T,norm::Bool) where T <: Real
17+
return Octonion{T}(s,v1,v2,v3,v4,v5,v6,v7,norm)
1118
end
1219

1320
Octonion{T}(x::Real) where {T<:Real} = Octonion(convert(T, x))

test/Octonion.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ using Test
7777
Octonion(1, 0, 0, 0, 0, 0, 0, 0, true) # test that .norm field does not affect equality
7878
end
7979

80+
@testset "deprecated warning" begin
81+
@test_deprecated Octonion(1, 2, 3, 4, 5, 6, 7, 8)
82+
@test_deprecated Octonion{Int}(1, 2, 3, 4, 5, 6, 7, 8, false)
83+
@test_deprecated Octonion{Float64}(1, 2, 3, 4, 5, 6, 7, 8, false)
84+
end
85+
8086
@testset "convert" begin
8187
@test convert(Octonion{Float64}, 1) === Octonion(1.0)
8288
@test convert(Octonion{Float64}, Complex(1, 2)) ===

0 commit comments

Comments
 (0)