Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.

Commit bfd7f34

Browse files
authored
Minor 0.6 cleanup (#268)
This change removes unnecessary `Compat.` prefixes, updates the type definition syntax to `struct`, and bumps the required Julia version from a 0.6 prerelease to 0.6 release.
1 parent f9ea7a2 commit bfd7f34

File tree

8 files changed

+12
-14
lines changed

8 files changed

+12
-14
lines changed

REQUIRE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.6.0-pre
1+
julia 0.6
22
Compat 0.8.6
33
StatsBase 0.15.0
44
Reexport

benchmark/operators.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module DataArraysBenchmark
2-
using DataArrays, Benchmark, Compat
2+
using DataArrays, Benchmark
33

44
# seed rng for more consistent timings
55
srand(1776)

src/broadcast.jl

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
using DataArrays
21
using Base: @get!, promote_eltype
32
using Base.Broadcast: bitcache_chunks, bitcache_size, dumpbitcache
4-
using Compat: promote_eltype_op
53

64
_broadcast_shape(x...) = Base.to_shape(Base.Broadcast.broadcast_indices(x...))
75

src/deprecated.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function percent_change{T}(v::Vector{T})
3131
return res
3232
end
3333

34-
type xtab{T}
34+
mutable struct xtab{T}
3535
vals::Array{T}
3636
counts::Vector{Int}
3737
end

src/extras.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ cut(x::AbstractVector, ngroups::Integer) = cut(x, quantile(x, collect(1 : ngroup
8484
function Base.repeat{T,N}(A::DataArray{T,N};
8585
inner = ntuple(x->1, ndims(A)),
8686
outer = ntuple(x->1, ndims(A)))
87-
DataArray{T,N}(Compat.repeat(A.data; inner=inner, outer=outer),
88-
BitArray(Compat.repeat(A.na; inner=inner, outer=outer)))
87+
DataArray{T,N}(repeat(A.data; inner=inner, outer=outer),
88+
BitArray(repeat(A.na; inner=inner, outer=outer)))
8989
end
9090

9191
function Base.repeat{T,R,N}(A::PooledDataArray{T,R,N};
9292
inner = ntuple(x->1, ndims(A)),
9393
outer = ntuple(x->1, ndims(A)))
94-
PooledDataArray(RefArray{R,N}(Compat.repeat(A.refs; inner=inner, outer=outer)),
94+
PooledDataArray(RefArray{R,N}(repeat(A.refs; inner=inner, outer=outer)),
9595
A.pool)
9696
end

src/operators.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ end
496496
if isdefined(Base, :UniformScaling)
497497

498498
function (+){TA,TJ}(A::DataArray{TA,2},J::UniformScaling{TJ})
499-
n = Compat.LinAlg.checksquare(A)
499+
n = LinAlg.checksquare(A)
500500
B = similar(A,promote_type(TA,TJ))
501501
copy!(B,A)
502502
@inbounds for i = 1:n
@@ -509,7 +509,7 @@ end
509509
(+){TA}(J::UniformScaling,A::DataArray{TA,2}) = A + J
510510

511511
function (-){TA,TJ<:Number}(A::DataArray{TA,2},J::UniformScaling{TJ})
512-
n = Compat.LinAlg.checksquare(A)
512+
n = LinAlg.checksquare(A)
513513
B = similar(A,promote_type(TA,TJ))
514514
copy!(B,A)
515515
@inbounds for i = 1:n
@@ -520,7 +520,7 @@ function (-){TA,TJ<:Number}(A::DataArray{TA,2},J::UniformScaling{TJ})
520520
B
521521
end
522522
function (-){TA,TJ<:Number}(J::UniformScaling{TJ},A::DataArray{TA,2})
523-
n = Compat.LinAlg.checksquare(A)
523+
n = LinAlg.checksquare(A)
524524
B = -A
525525
@inbounds for i = 1:n
526526
if !B.na[i,i]

src/reducedim.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ Base.mean{T}(A::DataArray{T}, region; skipna::Bool=false) =
336336

337337
## var
338338

339-
immutable MapReduceDim2ArgHelperFun{F,T}
339+
struct MapReduceDim2ArgHelperFun{F,T}
340340
f::F
341341
val::T
342342
end
@@ -478,7 +478,7 @@ end
478478
return R
479479
end
480480

481-
immutable Abs2MinusFun end
481+
struct Abs2MinusFun end
482482
(::Abs2MinusFun)(x, m) = abs2(x - m)
483483

484484
function Base.varm!(R::AbstractArray, A::DataArray, m::AbstractArray; corrected::Bool=true,

test/newtests/dataarray.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# TODO: Pull in existing tests into this file
33
# TODO: Rename to TestDataArray
44
module TestDataArrays
5-
using DataArrays, Base.Test, Compat
5+
using DataArrays, Base.Test
66

77
# DataArray{T, N}(d::Array{T, N}, m::BitArray{N} = falses(size(d)))
88
DataArray([1, 2], falses(2))

0 commit comments

Comments
 (0)