Skip to content

Commit bf302ae

Browse files
authored
Add deprecated messages for cis and cispi (#96)
* add deprecated messages for cis and cispi * add `@test_deprecated` for cis * update depwarn messages for cis and cispi
1 parent 7c606f1 commit bf302ae

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/Quaternion.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,19 @@ if VERSION ≥ v"1.6"
178178
!!! Note
179179
This is not equivalent to `exp(π*im*q)`. See [cis(::Quaternion)](@ref) for details.
180180
"""
181-
Base.cispi(q::Quaternion) = extend_analytic(cispi, q)
181+
function Base.cispi(q::Quaternion)
182+
Base.depwarn("`cispi(::Quaternion)` is deprecated and will be removed in the next breaking release. See https://github.com/JuliaGeometry/Quaternions.jl/pull/76 for more information.", :cispi)
183+
extend_analytic(cispi, q)
184+
end
185+
end
186+
187+
function Base.cis(q::Quaternion)
188+
Base.depwarn("`cis(::Quaternion)` is deprecated and will be removed in the next breaking release. See https://github.com/JuliaGeometry/Quaternions.jl/pull/76 for more information.", :cis)
189+
extend_analytic(cis, q)
182190
end
183191

184192
for f in (
185-
:sqrt, :exp, :exp2, :exp10, :expm1, :log2, :log10, :log1p, :cis,
193+
:sqrt, :exp, :exp2, :exp10, :expm1, :log2, :log10, :log1p,
186194
:sin, :cos, :tan, :asin, :acos, :atan, :sinh, :cosh, :tanh, :asinh, :acosh, :atanh,
187195
:csc, :sec, :cot, :acsc, :asec, :acot, :csch, :sech, :coth, :acsch, :asech, :acoth,
188196
:sinpi, :cospi,

test/Quaternion.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ Base.:(/)(a::MyReal, b::Real) = a.val / b
410410
]
411411
@test f(q) finv(inv(q))
412412
end
413-
@test cis(q) exp(normalize(q - real(q)) * q)
414-
VERSION v"1.6" && @test cispi(q) cis* q)
413+
@test @test_deprecated(cis(q)) exp(normalize(q - real(q)) * q)
414+
VERSION v"1.6" && @test @test_deprecated(cispi(q)) cis* q)
415415
end
416416
end
417417

0 commit comments

Comments
 (0)