Skip to content

Commit 04ec67a

Browse files
committed
Fix deprecation warnings on v0.6
1 parent 19b71ed commit 04ec67a

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@ os:
55
- osx
66
julia:
77
- 0.5
8+
- 0.6
9+
- nightly
810
matrix:
911
allow_failures:
12+
- julia: 0.6
1013
- julia: nightly
1114
notifications:
1215
email: false

appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ environment:
22
matrix:
33
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"
44
- JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe"
5+
- JULIAVERSION: "julialang/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
6+
- JULIAVERSION: "julialang/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
7+
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
8+
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
59
matrix:
610
allow_failures:
11+
- JULIAVERSION: "julialang/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
12+
- JULIAVERSION: "julialang/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
713
- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe"
814
- JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe"
915
branches:

src/array_partition.jl

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,31 +24,33 @@ function Base.ones(A::ArrayPartition)
2424
B
2525
end
2626

27-
Base.:+(A::ArrayPartition, B::ArrayPartition) = ArrayPartition((x .+ y for (x,y) in zip(A.x,B.x))...)
27+
Base.:+(A::ArrayPartition, B::ArrayPartition) =
28+
ArrayPartition((x .+ y for (x,y) in zip(A.x,B.x))...)
2829
Base.:+(A::Number, B::ArrayPartition) = ArrayPartition((A .+ x for x in B.x)...)
2930
Base.:+(A::ArrayPartition, B::Number) = ArrayPartition((B .+ x for x in A.x)...)
30-
Base.:-(A::ArrayPartition, B::ArrayPartition) = ArrayPartition((x .- y for (x,y) in zip(A.x,B.x))...)
31+
Base.:-(A::ArrayPartition, B::ArrayPartition) =
32+
ArrayPartition((x .- y for (x,y) in zip(A.x,B.x))...)
3133
Base.:-(A::Number, B::ArrayPartition) = ArrayPartition((A .- x for x in B.x)...)
3234
Base.:-(A::ArrayPartition, B::Number) = ArrayPartition((x .- B for x in A.x)...)
3335
Base.:*(A::Number, B::ArrayPartition) = ArrayPartition((A .* x for x in B.x)...)
3436
Base.:*(A::ArrayPartition, B::Number) = ArrayPartition((x .* B for x in A.x)...)
3537
Base.:/(A::ArrayPartition, B::Number) = ArrayPartition((x ./ B for x in A.x)...)
3638
Base.:\(A::Number, B::ArrayPartition) = ArrayPartition((x ./ A for x in B.x)...)
3739

38-
if VERSION < v"0.6-"
39-
Base.:.+(A::ArrayPartition, B::ArrayPartition) = ArrayPartition((x .+ y for (x,y) in zip(A.x,B.x))...)
40-
Base.:.+(A::Number, B::ArrayPartition) = ArrayPartition((A .+ x for x in B.x)...)
41-
Base.:.+(A::ArrayPartition, B::Number) = ArrayPartition((B .+ x for x in A.x)...)
42-
Base.:.-(A::ArrayPartition, B::ArrayPartition) = ArrayPartition((x .- y for (x,y) in zip(A.x,B.x))...)
43-
Base.:.-(A::Number, B::ArrayPartition) = ArrayPartition((A .- x for x in B.x)...)
44-
Base.:.-(A::ArrayPartition, B::Number) = ArrayPartition((x .- B for x in A.x)...)
45-
Base.:.*(A::ArrayPartition, B::ArrayPartition) = ArrayPartition((x .* y for (x,y) in zip(A.x,B.x))...)
46-
Base.:.*(A::Number, B::ArrayPartition) = ArrayPartition((A .* x for x in B.x)...)
47-
Base.:.*(A::ArrayPartition, B::Number) = ArrayPartition((x .* B for x in A.x)...)
48-
Base.:./(A::ArrayPartition, B::ArrayPartition) = ArrayPartition((x ./ y for (x,y) in zip(A.x,B.x))...)
49-
Base.:./(A::ArrayPartition, B::Number) = ArrayPartition((x ./ B for x in A.x)...)
50-
Base.:.\(A::Number, B::ArrayPartition) = ArrayPartition((x ./ A for x in B.x)...)
51-
end
40+
VERSION < v"0.6.0-dev.1614" && include_string("""
41+
Base.:.+(A::ArrayPartition, B::ArrayPartition) = A+B
42+
Base.:.+(A::Number, B::ArrayPartition) = A+B
43+
Base.:.+(A::ArrayPartition, B::Number) = A+B
44+
Base.:.-(A::ArrayPartition, B::ArrayPartition) = A-B
45+
Base.:.-(A::Number, B::ArrayPartition) = A-B
46+
Base.:.-(A::ArrayPartition, B::Number) = A-B
47+
Base.:.*(A::ArrayPartition, B::ArrayPartition) = A*B
48+
Base.:.*(A::Number, B::ArrayPartition) = A*B
49+
Base.:.*(A::ArrayPartition, B::Number) = A*B
50+
Base.:./(A::ArrayPartition, B::ArrayPartition) = A/B
51+
Base.:./(A::ArrayPartition, B::Number) = A/B
52+
Base.:.\(A::Number, B::ArrayPartition) = A\B
53+
""")
5254

5355
@inline function Base.getindex( A::ArrayPartition,i::Int)
5456
@boundscheck i > length(A) && throw(BoundsError("Index out of bounds"))

0 commit comments

Comments
 (0)