Skip to content

Commit ecd60d5

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

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ os:
55
- osx
66
julia:
77
- 0.5
8+
- release
9+
- nightly
810
matrix:
911
allow_failures:
1012
- julia: nightly

src/array_partition.jl

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,30 +24,32 @@ 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)...)
40+
@static if VERSION < v"0.6.0-dev.1614"
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
5153
end
5254

5355
@inline function Base.getindex( A::ArrayPartition,i::Int)

0 commit comments

Comments
 (0)