Skip to content

Commit 72b6d04

Browse files
authored
Merge pull request #87 from JuliaGraphics/teh/0.7
Bump requirements to julia-0.7
2 parents ae92d14 + 1104a12 commit 72b6d04

File tree

6 files changed

+22
-56
lines changed

6 files changed

+22
-56
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.6
87
- nightly
98
notifications:
109
email: false

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
julia 0.6
1+
julia 0.7.0-beta.85
22
Colors 0.7.1
33
ColorTypes 0.6.3
44
FixedPointNumbers 0.3.0
55
StatsBase 0.8.2
6-
Compat 0.18.0
76
SpecialFunctions

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
53
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
64
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
75

src/ColorVectorSpace.jl

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ __precompile__(true)
22

33
module ColorVectorSpace
44

5-
using Colors, FixedPointNumbers, SpecialFunctions, Compat
6-
import StatsBase: histrange
5+
using Colors, FixedPointNumbers, SpecialFunctions
76

87
import Base: ==, +, -, *, /, ^, <, ~
98
import Base: abs, abs2, clamp, convert, copy, div, eps, isfinite, isinf,
10-
isnan, isless, length, mapreduce, norm, oneunit, promote_array_type,
9+
isnan, isless, length, mapreduce, oneunit,
1110
promote_op, promote_rule, zero, trunc, floor, round, ceil, bswap,
12-
mod, rem, atan2, hypot, max, min, varm, real, typemin, typemax
11+
mod, rem, atan2, hypot, max, min, real, typemin, typemax
12+
import LinearAlgebra: norm
13+
import StatsBase: histrange, varm
14+
import SpecialFunctions: gamma, lgamma, lfact
15+
import Statistics: middle
1316

1417
export nan
1518

@@ -23,9 +26,9 @@ import Base: conj, sin, cos, tan, sinh, cosh, tanh,
2326
asind, atand, rad2deg, deg2rad,
2427
log, log2, log10, log1p, exponent, exp,
2528
exp2, expm1, cbrt, sqrt,
26-
significand, lgamma,
27-
gamma, lfact, frexp, modf,
28-
float, middle
29+
significand,
30+
frexp, modf,
31+
float
2932

3033
export dotc
3134

@@ -60,14 +63,9 @@ end
6063

6164
for f in (:trunc, :floor, :round, :ceil, :eps, :bswap)
6265
@eval $f(g::Gray{T}) where {T} = Gray{T}($f(gray(g)))
63-
@eval Compat.@dep_vectorize_1arg Gray $f
6466
end
6567
eps(::Type{Gray{T}}) where {T} = Gray(eps(T))
66-
Compat.@dep_vectorize_1arg AbstractGray isfinite
67-
Compat.@dep_vectorize_1arg AbstractGray isinf
68-
Compat.@dep_vectorize_1arg AbstractGray isnan
69-
Compat.@dep_vectorize_1arg AbstractGray abs
70-
Compat.@dep_vectorize_1arg AbstractGray abs2
68+
7169
for f in (:trunc, :floor, :round, :ceil)
7270
@eval $f(::Type{T}, g::Gray) where {T<:Integer} = Gray{T}($f(T, gray(g)))
7371
end
@@ -274,7 +272,7 @@ function Base.isapprox(x::AbstractArray{Cx},
274272
y::AbstractArray{Cy};
275273
rtol::Real=Base.rtoldefault(eltype(Cx),eltype(Cy),0),
276274
atol::Real=0,
277-
norm::Function=vecnorm) where {Cx<:MathTypes,Cy<:MathTypes}
275+
norm::Function=norm) where {Cx<:MathTypes,Cy<:MathTypes}
278276
d = norm(x - y)
279277
if isfinite(d)
280278
return d <= atol + rtol*max(norm(x), norm(y))
@@ -293,16 +291,8 @@ dotc(x::AbstractGray, y::AbstractGray) = dotc(promote(x, y)...)
293291
float(::Type{T}) where {T<:Gray} = typeof(float(zero(T)))
294292

295293
# Mixed types
296-
if VERSION < v"0.7.0-DEV.2138"
297-
(+)(a::MathTypes, b::MathTypes) = (+)(Base.promote_noncircular(a, b)...)
298-
(-)(a::MathTypes, b::MathTypes) = (-)(Base.promote_noncircular(a, b)...)
299-
else
300-
(+)(a::MathTypes, b::MathTypes) = (+)(promote(a, b)...)
301-
(-)(a::MathTypes, b::MathTypes) = (-)(promote(a, b)...)
302-
end
303-
304-
Compat.@dep_vectorize_2arg Gray max
305-
Compat.@dep_vectorize_2arg Gray min
294+
(+)(a::MathTypes, b::MathTypes) = (+)(promote(a, b)...)
295+
(-)(a::MathTypes, b::MathTypes) = (-)(promote(a, b)...)
306296

307297
# Arrays
308298
+(A::AbstractArray{C}) where {C<:MathTypes} = A
@@ -345,7 +335,6 @@ real(::Type{C}) where {C<:AbstractGray} = real(eltype(C))
345335
histrange(v::AbstractArray{Gray{T}}, n::Integer) where {T} = histrange(convert(Array{Float32}, map(gray, v)), n, :right)
346336

347337
# To help type inference
348-
promote_array_type(F, ::Type{T}, ::Type{C}) where {T<:Real,C<:MathTypes} = base_colorant_type(C){Base.promote_array_type(F, T, eltype(C))}
349338
promote_rule(::Type{T}, ::Type{C}) where {T<:Real,C<:AbstractGray} = promote_type(T, eltype(C))
350339

351340
typemin(::Type{T}) where {T<:ColorTypes.AbstractGray} = T(typemin(eltype(T)))
@@ -354,18 +343,4 @@ typemax(::Type{T}) where {T<:ColorTypes.AbstractGray} = T(typemax(eltype(T)))
354343
typemin(::T) where {T<:ColorTypes.AbstractGray} = T(typemin(eltype(T)))
355344
typemax(::T) where {T<:ColorTypes.AbstractGray} = T(typemax(eltype(T)))
356345

357-
# deprecations
358-
function Base.one(::Type{C}) where {C<:Union{TransparentGray,AbstractRGB,TransparentRGB}}
359-
Base.depwarn("one($C) will soon switch to returning 1; you might need to switch to `oneunit`", :one)
360-
C(_onetuple(C)...)
361-
end
362-
_onetuple(::Type{C}) where {C<:Colorant{T,N}} where {T,N} = ntuple(d->1, Val(N))
363-
364-
for f in (:min, :max)
365-
@eval begin
366-
@deprecate($f{T<:Gray}(x::Number, y::AbstractArray{T}), $f.(x, y))
367-
@deprecate($f{T<:Gray}(x::AbstractArray{T}, y::Number), $f.(x, y))
368-
end
369-
end
370-
371346
end

test/REQUIRE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
BaseTestNext
21
StatsBase

test/runtests.jl

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
module ColorVectorSpaceTests
22

3-
using ColorVectorSpace, Colors, FixedPointNumbers, Compat, StatsBase
3+
using LinearAlgebra, Statistics
4+
using ColorVectorSpace, Colors, FixedPointNumbers, StatsBase
45

5-
using Base.Test
6+
using Test
7+
8+
const var = Statistics.var
69

710
macro test_colortype_approx_eq(a, b)
811
:(test_colortype_approx_eq($(esc(a)), $(esc(b)), $(string(a)), $(string(b))))
@@ -57,8 +60,6 @@ end
5760
@test 2.0f0*cu == Gray(2.0f0*cu.val)
5861
f = N0f8(0.5)
5962
@test (f*cu).val f*cu.val
60-
@test 2 .* cf == ccmp
61-
@test cf.*2 == ccmp
6263
@test cf/2.0f0 == Gray{Float32}(0.05)
6364
@test cu/2 == Gray(cu.val/2)
6465
@test cu/0.5f0 == Gray(cu.val/0.5f0)
@@ -89,8 +90,6 @@ end
8990
@test typeof(acu-acf) == Vector{Gray{Float32}}
9091
@test typeof(acu.+acf) == Vector{Gray{Float32}}
9192
@test typeof(acu.-acf) == Vector{Gray{Float32}}
92-
@test typeof(acu+cf) == Vector{Gray{Float32}}
93-
@test typeof(acu-cf) == Vector{Gray{Float32}}
9493
@test typeof(acu.+cf) == Vector{Gray{Float32}}
9594
@test typeof(acu.-cf) == Vector{Gray{Float32}}
9695
@test typeof(2*acf) == Vector{Gray{Float32}}
@@ -161,6 +160,7 @@ end
161160
v = @eval $op(gray(g)) # if this fails, don't bother
162161
@show op
163162
@test op(g) == v
163+
catch
164164
end
165165
end
166166
end
@@ -225,8 +225,6 @@ end
225225
@test_colortype_approx_eq 2.0f0*cu RGB(2.0f0*cu.r, 2.0f0*cu.g, 2.0f0*cu.b)
226226
f = N0f8(0.5)
227227
@test (f*cu).r f*cu.r
228-
@test 2 .* cf == ccmp
229-
@test cf.*2 == ccmp
230228
@test cf/2.0f0 == RGB{Float32}(0.05,0.1,0.15)
231229
@test cu/2 RGB(cu.r/2,cu.g/2,cu.b/2)
232230
@test cu/0.5f0 == RGB(cu.r/0.5f0, cu.g/0.5f0, cu.b/0.5f0)
@@ -300,8 +298,6 @@ end
300298
@test_colortype_approx_eq 2.0f0*cu RGBA(2.0f0*cu.r, 2.0f0*cu.g, 2.0f0*cu.b, 2.0f0*cu.alpha)
301299
f = N0f8(0.5)
302300
@test (f*cu).r f*cu.r
303-
@test 2 .* cf == ccmp
304-
@test cf.*2 == ccmp
305301
@test cf/2.0f0 == RGBA{Float32}(0.05,0.1,0.15,0.2)
306302
@test cu/2 == RGBA(cu.r/2,cu.g/2,cu.b/2,cu.alpha/2)
307303
@test cu/0.5f0 == RGBA(cu.r/0.5f0, cu.g/0.5f0, cu.b/0.5f0, cu.alpha/0.5f0)
@@ -379,7 +375,7 @@ end
379375
@test typemax(Gray{T}) === Gray{T}(typemax(T))
380376
@test typemin(Gray{T}(0.5)) === Gray{T}(typemin(T))
381377
@test typemax(Gray{T}(0.5)) === Gray{T}(typemax(T))
382-
A = maximum(Gray{T}.([1 0 0; 0 1 0]), 1) # see PR#44 discussion
378+
A = maximum(Gray{T}.([1 0 0; 0 1 0]); dims=1) # see PR#44 discussion
383379
@test isa(A, Matrix{Gray{T}})
384380
@test size(A) == (1,3)
385381
end

0 commit comments

Comments
 (0)