Skip to content

Commit

Permalink
Merge cbcac89 into f031a3d
Browse files Browse the repository at this point in the history
  • Loading branch information
Nosferican committed Nov 26, 2017
2 parents f031a3d + cbcac89 commit 0bd32b2
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 54 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Reexport
WeakRefStrings 0.4.0
DataStreams 0.3.0
GZip
Compat 0.36.0
2 changes: 1 addition & 1 deletion src/DataFrames.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module DataFrames
##
##############################################################################

using Reexport, StatsBase, SortingAlgorithms
using Reexport, StatsBase, SortingAlgorithms, Compat
@reexport using CategoricalArrays, Missings

using Base: Sort, Order
Expand Down
2 changes: 1 addition & 1 deletion src/abstractdataframe/reshape.jl
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ function Base.getindex(v::RepeatedVector{T},i::Real) where T
idx = Base.fld1(mod1(i,v.inner*N),v.inner)
v.parent[idx]
end
Base.getindex(v::RepeatedVector,i::Range) = getindex(v, [i;])
Base.getindex(v::RepeatedVector,i::AbstractRange) = getindex(v, [i;])

Base.size(v::RepeatedVector) = (length(v),)
Base.length(v::RepeatedVector) = v.inner * v.outer * length(v.parent)
Expand Down
2 changes: 1 addition & 1 deletion src/abstractdataframe/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let
function ourstrwidth(x::Any) # -> Int
truncate(io, 0)
ourshowcompact(io, x)
strwidth(String(take!(io)))
textwidth(String(take!(io)))
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/dataframe/dataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ mutable struct DataFrame <: AbstractDataFrame
end
end
for (i, c) in enumerate(columns)
if isa(c, Range)
if isa(c, AbstractRange)
columns[i] = collect(c)
elseif !isa(c, AbstractVector)
throw(DimensionMismatch("columns must be 1-dimensional"))
Expand Down
96 changes: 48 additions & 48 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ end

## read.table

immutable ParsedCSV
struct ParsedCSV
bytes::Vector{UInt8} # Raw bytes from CSV file
bounds::Vector{Int} # Right field boundary indices
lines::Vector{Int} # Line break indices
quoted::BitVector # Was field quoted in text
end

immutable ParseOptions{S <: String, T <: String}
struct ParseOptions{S <: String, T <: String}
header::Bool
separator::Char
quotemarks::Vector{Char}
Expand All @@ -140,7 +140,7 @@ end

# Dispatch on values of ParseOptions to avoid running
# unused checks for every byte read
immutable ParseType{ALLOWCOMMENTS, SKIPBLANKS, ALLOWESCAPES, SPC_SEP} end
struct ParseType{ALLOWCOMMENTS, SKIPBLANKS, ALLOWESCAPES, SPC_SEP} end
ParseType(o::ParseOptions) = ParseType{o.allowcomments, o.skipblanks, o.allowescapes, o.separator == ' '}()

macro read_peek_eof(io, nextchr)
Expand Down Expand Up @@ -463,10 +463,10 @@ for allowcomments in tf, skipblanks in tf, allowescapes in tf, wsv in tf
end
end

function bytematch{T <: String}(bytes::Vector{UInt8},
left::Integer,
right::Integer,
exemplars::Vector{T})
function bytematch(bytes::Vector{UInt8},
left::Integer,
right::Integer,
exemplars::Vector{T}) where T <: String
l = right - left + 1
for index in 1:length(exemplars)
exemplar = exemplars[index]
Expand All @@ -483,16 +483,16 @@ function bytematch{T <: String}(bytes::Vector{UInt8},
return false
end

function bytestotype{N <: Integer,
T <: String,
P <: String}(::Type{N},
bytes::Vector{UInt8},
left::Integer,
right::Integer,
nastrings::Vector{T},
wasquoted::Bool = false,
truestrings::Vector{P} = P[],
falsestrings::Vector{P} = P[])
function bytestotype(::Type{N},
bytes::Vector{UInt8},
left::Integer,
right::Integer,
nastrings::Vector{T},
wasquoted::Bool = false,
truestrings::Vector{P} = P[],
falsestrings::Vector{P} = P[]) where {N <: Integer,
T <: String,
P <: String}
if left > right
return 0, true, true
end
Expand Down Expand Up @@ -531,16 +531,16 @@ end

let out = Vector{Float64}(1)
global bytestotype
function bytestotype{N <: AbstractFloat,
T <: String,
P <: String}(::Type{N},
bytes::Vector{UInt8},
left::Integer,
right::Integer,
nastrings::Vector{T},
wasquoted::Bool = false,
truestrings::Vector{P} = P[],
falsestrings::Vector{P} = P[])
function bytestotype(::Type{N},
bytes::Vector{UInt8},
left::Integer,
right::Integer,
nastrings::Vector{T},
wasquoted::Bool = false,
truestrings::Vector{P} = P[],
falsestrings::Vector{P} = P[]) where {N <: AbstractFloat,
T <: String,
P <: String}
if left > right
return 0.0, true, true
end
Expand All @@ -561,16 +561,16 @@ let out = Vector{Float64}(1)
end
end

function bytestotype{N <: Bool,
T <: String,
P <: String}(::Type{N},
bytes::Vector{UInt8},
left::Integer,
right::Integer,
nastrings::Vector{T},
wasquoted::Bool = false,
truestrings::Vector{P} = P[],
falsestrings::Vector{P} = P[])
function bytestotype(::Type{N},
bytes::Vector{UInt8},
left::Integer,
right::Integer,
nastrings::Vector{T},
wasquoted::Bool = false,
truestrings::Vector{P} = P[],
falsestrings::Vector{P} = P[]) where {N <: Bool,
T <: String,
P <: String}
if left > right
return false, true, true
end
Expand All @@ -588,16 +588,16 @@ function bytestotype{N <: Bool,
end
end

function bytestotype{N <: AbstractString,
T <: String,
P <: String}(::Type{N},
bytes::Vector{UInt8},
left::Integer,
right::Integer,
nastrings::Vector{T},
wasquoted::Bool = false,
truestrings::Vector{P} = P[],
falsestrings::Vector{P} = P[])
function bytestotype(::Type{N},
bytes::Vector{UInt8},
left::Integer,
right::Integer,
nastrings::Vector{T},
wasquoted::Bool = false,
truestrings::Vector{P} = P[],
falsestrings::Vector{P} = P[]) where {N <: AbstractString,
T <: String,
P <: String}
if left > right
if wasquoted
return "", true, false
Expand Down Expand Up @@ -1276,4 +1276,4 @@ end
@deprecate rename!(x::Index, f::Function) rename!(f, x)
@deprecate rename(x::AbstractDataFrame, from::AbstractArray, to::AbstractArray) rename(x, [f=>t for (f, t) in zip(from, to)])
@deprecate rename(x::AbstractDataFrame, from::Symbol, to::Symbol) rename(x, from => to)
@deprecate rename(x::Index, f::Function) rename(f, x)
@deprecate rename(x::Index, f::Function) rename(f, x)
2 changes: 1 addition & 1 deletion src/groupeddataframe/grouping.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function combine(ga::GroupApplied)
j = 0
@inbounds for (start, val) in zip(gd.starts, vals)
n = size(val, 1)
idx[j + (1:n)] = gd.idx[start]
idx[j .+ (1:n)] = gd.idx[start]
j += n
end
hcat!(gd.parent[idx, gd.cols], valscat)
Expand Down
2 changes: 1 addition & 1 deletion src/other/index.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Base.getindex(x::AbstractIndex, idx::AbstractVector{Union{Bool, Missing}}) =
Base.getindex(x::AbstractIndex, idx::AbstractVector{Bool}) = find(idx)
Base.getindex(x::AbstractIndex, idx::AbstractVector{T}) where {T >: Missing} =
getindex(x, collect(skipmissing(idx)))
Base.getindex(x::AbstractIndex, idx::Range) = [idx;]
Base.getindex(x::AbstractIndex, idx::AbstractRange) = [idx;]
Base.getindex(x::AbstractIndex, idx::AbstractVector{T}) where {T <: Real} = convert(Vector{Int}, idx)
Base.getindex(x::AbstractIndex, idx::AbstractVector{Symbol}) = [x.lookup[i] for i in idx]

Expand Down

0 comments on commit 0bd32b2

Please sign in to comment.