Skip to content

Commit adafb1a

Browse files
committed
Bump Julia version and eliminate some version-dependent code
1 parent 101823d commit adafb1a

File tree

6 files changed

+18
-164
lines changed

6 files changed

+18
-164
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.5
7+
- 0.6
88
- nightly
99
notifications:
1010
email: false

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.5
1+
julia 0.6
22
Colors 0.7.1
33
ColorTypes 0.4
44
FixedPointNumbers 0.3.0

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
environment:
22
matrix:
3-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
4-
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
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"
55
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
66
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
77

src/ColorVectorSpace.jl

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -280,19 +280,8 @@ dotc(x::AbstractGray, y::AbstractGray) = dotc(promote(x, y)...)
280280
float{T<:Gray}(::Type{T}) = typeof(float(zero(T)))
281281

282282
# Mixed types
283-
if VERSION < v"0.6.0-dev.2009"
284-
(+)(a::MathTypes, b::MathTypes) = (+)(promote(a, b)...)
285-
(-)(a::MathTypes, b::MathTypes) = (-)(promote(a, b)...)
286-
else
287-
(+)(a::MathTypes, b::MathTypes) = (+)(Base.promote_noncircular(a, b)...)
288-
(-)(a::MathTypes, b::MathTypes) = (-)(Base.promote_noncircular(a, b)...)
289-
end
290-
291-
if VERSION < v"0.6.0-dev.1839"
292-
include("dots.jl")
293-
elseif VERSION < v"0.6.0-pre.beta.101"
294-
Base.Broadcast.eltypestuple(c::Colorant) = Tuple{typeof(c)}
295-
end
283+
(+)(a::MathTypes, b::MathTypes) = (+)(Base.promote_noncircular(a, b)...)
284+
(-)(a::MathTypes, b::MathTypes) = (-)(Base.promote_noncircular(a, b)...)
296285

297286
Compat.@dep_vectorize_2arg Gray max
298287
Compat.@dep_vectorize_2arg Gray min

src/dots.jl

Lines changed: 0 additions & 112 deletions
This file was deleted.

test/runtests.jl

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ using ColorVectorSpace, Colors, FixedPointNumbers, Compat, StatsBase
44

55
using Base.Test
66

7-
const use_broadcast_rules = VERSION >= v"0.6.0-dev.1839"
8-
97
macro test_colortype_approx_eq(a, b)
108
:(test_colortype_approx_eq($(esc(a)), $(esc(b)), $(string(a)), $(string(b))))
119
end
@@ -91,17 +89,10 @@ end
9189
@test typeof(acu-acf) == Vector{Gray{Float32}}
9290
@test typeof(acu.+acf) == Vector{Gray{Float32}}
9391
@test typeof(acu.-acf) == Vector{Gray{Float32}}
94-
if use_broadcast_rules
95-
@test typeof(acu+cf) == Vector{Gray{Float32}}
96-
@test typeof(acu-cf) == Vector{Gray{Float32}}
97-
@test typeof(acu.+cf) == Vector{Gray{Float32}}
98-
@test typeof(acu.-cf) == Vector{Gray{Float32}}
99-
else
100-
@test typeof(acu+cf) == Vector{Gray{N0f8}}
101-
@test typeof(acu-cf) == Vector{Gray{N0f8}}
102-
@test typeof(acu.+cf) == Vector{Gray{N0f8}}
103-
@test typeof(acu.-cf) == Vector{Gray{N0f8}}
104-
end
92+
@test typeof(acu+cf) == Vector{Gray{Float32}}
93+
@test typeof(acu-cf) == Vector{Gray{Float32}}
94+
@test typeof(acu.+cf) == Vector{Gray{Float32}}
95+
@test typeof(acu.-cf) == Vector{Gray{Float32}}
10596
@test typeof(2*acf) == Vector{Gray{Float32}}
10697
@test typeof(2.*acf) == Vector{Gray{Float32}}
10798
@test typeof(0x02*acu) == Vector{Gray{Float32}}
@@ -245,17 +236,10 @@ end
245236
@test typeof(acu-acf) == Vector{RGB{Float32}}
246237
@test typeof(acu.+acf) == Vector{RGB{Float32}}
247238
@test typeof(acu.-acf) == Vector{RGB{Float32}}
248-
if use_broadcast_rules
249-
@test typeof(acu+cf) == Vector{RGB{Float32}}
250-
@test typeof(acu-cf) == Vector{RGB{Float32}}
251-
@test typeof(acu.+cf) == Vector{RGB{Float32}}
252-
@test typeof(acu.-cf) == Vector{RGB{Float32}}
253-
else
254-
@test typeof(acu+cf) == Vector{RGB{N0f8}}
255-
@test typeof(acu-cf) == Vector{RGB{N0f8}}
256-
@test typeof(acu.+cf) == Vector{RGB{N0f8}}
257-
@test typeof(acu.-cf) == Vector{RGB{N0f8}}
258-
end
239+
@test typeof(acu+cf) == Vector{RGB{Float32}}
240+
@test typeof(acu-cf) == Vector{RGB{Float32}}
241+
@test typeof(acu.+cf) == Vector{RGB{Float32}}
242+
@test typeof(acu.-cf) == Vector{RGB{Float32}}
259243
@test typeof(2*acf) == Vector{RGB{Float32}}
260244
@test typeof(convert(UInt8, 2)*acu) == Vector{RGB{Float32}}
261245
@test typeof(acu/2) == Vector{RGB{typeof(N0f8(0.5)/2)}}
@@ -323,17 +307,10 @@ end
323307
@test typeof(acu-acf) == Vector{RGBA{Float32}}
324308
@test typeof(acu.+acf) == Vector{RGBA{Float32}}
325309
@test typeof(acu.-acf) == Vector{RGBA{Float32}}
326-
if use_broadcast_rules
327-
@test typeof(acu+cf) == Vector{RGBA{Float32}}
328-
@test typeof(acu-cf) == Vector{RGBA{Float32}}
329-
@test typeof(acu.+cf) == Vector{RGBA{Float32}}
330-
@test typeof(acu.-cf) == Vector{RGBA{Float32}}
331-
else
332-
@test typeof(acu+cf) == Vector{RGBA{N0f8}}
333-
@test typeof(acu-cf) == Vector{RGBA{N0f8}}
334-
@test typeof(acu.+cf) == Vector{RGBA{N0f8}}
335-
@test typeof(acu.-cf) == Vector{RGBA{N0f8}}
336-
end
310+
@test typeof(acu+cf) == Vector{RGBA{Float32}}
311+
@test typeof(acu-cf) == Vector{RGBA{Float32}}
312+
@test typeof(acu.+cf) == Vector{RGBA{Float32}}
313+
@test typeof(acu.-cf) == Vector{RGBA{Float32}}
337314
@test typeof(2*acf) == Vector{RGBA{Float32}}
338315
@test typeof(convert(UInt8, 2)*acu) == Vector{RGBA{Float32}}
339316
@test typeof(acu/2) == Vector{RGBA{typeof(N0f8(0.5)/2)}}

0 commit comments

Comments
 (0)