Skip to content

Commit

Permalink
Fix SpecialFunctions depwarns
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Mar 4, 2021
1 parent e3188d2 commit 012754f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ColorVectorSpace"
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
version = "0.9.1"
version = "0.9.2"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Expand All @@ -13,7 +13,7 @@ TensorCore = "62fd8b95-f654-4bbd-a8a5-9c27f68ccd50"
[compat]
ColorTypes = "0.10"
FixedPointNumbers = "0.8"
SpecialFunctions = "0.7, 0.8, 0.9, 0.10, 1"
SpecialFunctions = "0.9, 0.10, 1"
TensorCore = "0.1"
julia = "1"

Expand Down
12 changes: 8 additions & 4 deletions src/ColorVectorSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import Base: conj, sin, cos, tan, sinh, cosh, tanh,
exp2, exp10, expm1, cbrt, sqrt,
significand, frexp, modf
import LinearAlgebra: norm, , dot, promote_leaf_eltypes # norm1, norm2, normInf
import SpecialFunctions: gamma, lgamma, lfact
import SpecialFunctions: gamma, logabsgamma, lfact
using Statistics
import Statistics: middle, _mean_promote

Expand Down Expand Up @@ -213,17 +213,21 @@ const unaryOps = (:~, :conj, :abs,
:asind, :atand, :rad2deg, :deg2rad,
:log, :log2, :log10, :log1p, :exponent, :exp,
:exp2, :exp10, :expm1, :cbrt, :sqrt,
:significand, :lgamma,
:significand,
:gamma, :lfact, :frexp, :modf,
:(SpecialFunctions.erf), :(SpecialFunctions.erfc),
:(SpecialFunctions.erfcx), :(SpecialFunctions.erfi), :(SpecialFunctions.dawson),
:(SpecialFunctions.airy), :(SpecialFunctions.airyai),
:(SpecialFunctions.airyprime), :(SpecialFunctions.airyaiprime), :(SpecialFunctions.airybi), :(SpecialFunctions.airybiprime),
:(SpecialFunctions.airyai),
:(SpecialFunctions.airyaiprime), :(SpecialFunctions.airybi), :(SpecialFunctions.airybiprime),
:(SpecialFunctions.besselj0), :(SpecialFunctions.besselj1), :(SpecialFunctions.bessely0), :(SpecialFunctions.bessely1),
:(SpecialFunctions.eta), :(SpecialFunctions.zeta), :(SpecialFunctions.digamma))
for op in unaryOps
@eval ($op)(c::AbstractGray) = Gray($op(gray(c)))
end
function logabsgamma(c::AbstractGray)
lagc, s = logabsgamma(gray(c))
return Gray(lagc), s
end

middle(c::AbstractGray) = arith_colorant_type(c)(middle(gray(c)))
middle(x::C, y::C) where {C<:AbstractGray} = arith_colorant_type(C)(middle(gray(x), gray(y)))
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ ColorTypes.blue(c::RatRGB) = c.b
end
end
@test ntested > 130
@test logabsgamma(Gray(0.2)) == (Gray(logabsgamma(0.2)[1]), 1)
for g in (Gray{N0f8}(0.4), Gray{N0f8}(0.6))
for op in (:trunc, :floor, :round, :ceil)
v = @eval $op(Bool, gray($g))
Expand Down

0 comments on commit 012754f

Please sign in to comment.