Skip to content

Commit 8ed4f6c

Browse files
authored
Fix SpecialFunctions depwarns (#145)
xref #106 (comment)
1 parent 3072185 commit 8ed4f6c

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ColorVectorSpace"
22
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
3-
version = "0.9.1"
3+
version = "0.9.2"
44

55
[deps]
66
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
@@ -13,7 +13,7 @@ TensorCore = "62fd8b95-f654-4bbd-a8a5-9c27f68ccd50"
1313
[compat]
1414
ColorTypes = "0.10"
1515
FixedPointNumbers = "0.8"
16-
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1"
16+
SpecialFunctions = "0.8, 0.9, 0.10, 1"
1717
TensorCore = "0.1"
1818
julia = "1"
1919

src/ColorVectorSpace.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import Base: conj, sin, cos, tan, sinh, cosh, tanh,
2323
exp2, exp10, expm1, cbrt, sqrt,
2424
significand, frexp, modf
2525
import LinearAlgebra: norm, , dot, promote_leaf_eltypes # norm1, norm2, normInf
26-
import SpecialFunctions: gamma, lgamma, lfact
26+
import SpecialFunctions: gamma, logabsgamma, lfact
2727
using Statistics
2828
import Statistics: middle, _mean_promote
2929

@@ -213,17 +213,21 @@ const unaryOps = (:~, :conj, :abs,
213213
:asind, :atand, :rad2deg, :deg2rad,
214214
:log, :log2, :log10, :log1p, :exponent, :exp,
215215
:exp2, :exp10, :expm1, :cbrt, :sqrt,
216-
:significand, :lgamma,
216+
:significand,
217217
:gamma, :lfact, :frexp, :modf,
218218
:(SpecialFunctions.erf), :(SpecialFunctions.erfc),
219219
:(SpecialFunctions.erfcx), :(SpecialFunctions.erfi), :(SpecialFunctions.dawson),
220-
:(SpecialFunctions.airy), :(SpecialFunctions.airyai),
221-
:(SpecialFunctions.airyprime), :(SpecialFunctions.airyaiprime), :(SpecialFunctions.airybi), :(SpecialFunctions.airybiprime),
220+
:(SpecialFunctions.airyai),
221+
:(SpecialFunctions.airyaiprime), :(SpecialFunctions.airybi), :(SpecialFunctions.airybiprime),
222222
:(SpecialFunctions.besselj0), :(SpecialFunctions.besselj1), :(SpecialFunctions.bessely0), :(SpecialFunctions.bessely1),
223223
:(SpecialFunctions.eta), :(SpecialFunctions.zeta), :(SpecialFunctions.digamma))
224224
for op in unaryOps
225225
@eval ($op)(c::AbstractGray) = Gray($op(gray(c)))
226226
end
227+
function logabsgamma(c::AbstractGray)
228+
lagc, s = logabsgamma(gray(c))
229+
return Gray(lagc), s
230+
end
227231

228232
"""
229233
y = complement(x)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ ColorTypes.blue(c::RatRGB) = c.b
226226
end
227227
end
228228
@test ntested > 130
229+
@test logabsgamma(Gray(0.2)) == (Gray(logabsgamma(0.2)[1]), 1)
229230
for g in (Gray{N0f8}(0.4), Gray{N0f8}(0.6))
230231
for op in (:trunc, :floor, :round, :ceil)
231232
v = @eval $op(Bool, gray($g))

0 commit comments

Comments
 (0)