From 9179362035657667608b1d6d6776c6e38c66c3ce Mon Sep 17 00:00:00 2001 From: Christof Stocker Date: Sun, 10 Apr 2016 09:41:42 +0200 Subject: [PATCH] fix inference error for 3rd party packages --- src/UnicodePlots.jl | 4 ---- src/interface/scatterplot.jl | 31 ++++--------------------------- src/plot.jl | 2 +- src/precompile.jl | 19 ------------------- 4 files changed, 5 insertions(+), 51 deletions(-) delete mode 100644 src/precompile.jl diff --git a/src/UnicodePlots.jl b/src/UnicodePlots.jl index d0f0d473..6ae06f7e 100644 --- a/src/UnicodePlots.jl +++ b/src/UnicodePlots.jl @@ -64,8 +64,4 @@ include("interface/densityplot.jl") include("interface/spy.jl") include("deprecated.jl") -if VERSION >= v"0.4.0-dev+5512" - include("precompile.jl") -end - end diff --git a/src/interface/scatterplot.jl b/src/interface/scatterplot.jl index 24c646ae..802f94c9 100644 --- a/src/interface/scatterplot.jl +++ b/src/interface/scatterplot.jl @@ -97,8 +97,8 @@ function scatterplot{F<:Real,R<:Real}( name::AbstractString = "", canvas::Type = BrailleCanvas, args...) - X = convert(Vector{Float64}, x) - Y = convert(Vector{Float64}, y) + X = convert(Vector{Float64}, collect(x)) + Y = convert(Vector{Float64}, collect(y)) new_plot = Plot(X, Y, canvas; args...) color = (color == :auto) ? next_color!(new_plot) : color name == "" || annotate!(new_plot, :r, name, color) @@ -110,25 +110,13 @@ function scatterplot!{T<:Canvas,F<:Real,R<:Real}( color::Symbol = :auto, name::AbstractString = "", args...) - X = convert(Vector{Float64}, x) - Y = convert(Vector{Float64}, y) + X = convert(Vector{Float64}, collect(x)) + Y = convert(Vector{Float64}, collect(y)) color = (color == :auto) ? next_color!(plot) : color name == "" || annotate!(plot, :r, name, color) points!(plot, X, Y, color) end -function scatterplot{F<:Real,R<:Real}(X::Range{F}, Y::Range{R}; args...) - scatterplot(collect(X), collect(Y); args...) -end - -function scatterplot{F<:Real}(X::Range, Y::AbstractVector{F}; args...) - scatterplot(collect(X), Y; args...) -end - -function scatterplot{F<:Real}(X::AbstractVector{F}, Y::Range; args...) - scatterplot(X, collect(Y); args...) -end - function scatterplot(X::AbstractVector; args...) scatterplot(1:length(X), X; args...) end @@ -137,14 +125,3 @@ function scatterplot!{T<:Canvas}(plot::Plot{T}, X::AbstractVector; args...) scatterplot!(plot, 1:length(X), X; args...) end -function scatterplot!{T<:Canvas,F<:Real,R<:Real}(plot::Plot{T}, X::Range{F}, Y::Range{R}; args...) - scatterplot!(plot, collect(X), collect(Y); args...) -end - -function scatterplot!{T<:Canvas,F<:Real}(plot::Plot{T}, X::Range, Y::AbstractVector{F}; args...) - scatterplot!(plot, collect(X), Y; args...) -end - -function scatterplot!{T<:Canvas,F<:Real}(plot::Plot{T}, X::AbstractVector{F}, Y::Range; args...) - scatterplot!(plot, X, collect(Y); args...) -end diff --git a/src/plot.jl b/src/plot.jl index e90e4c58..76598015 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -338,7 +338,7 @@ function print_border_bottom(io::IO, padding::AbstractString, length::Int, borde end function Base.show(io::IO, p::Plot) - b = bordermap[p.border] + b = UnicodePlots.bordermap[p.border] c = p.graphics border_length = ncols(c) diff --git a/src/precompile.jl b/src/precompile.jl deleted file mode 100644 index 23addc63..00000000 --- a/src/precompile.jl +++ /dev/null @@ -1,19 +0,0 @@ -precompile(lineplot, (Vector{Function},)) -precompile(lineplot, (Vector{Function}, Int64, Int64,)) -precompile(lineplot, (Vector{Float64}, )) -precompile(lineplot, (Vector{Float64}, Vector{Float64},)) -precompile(scatterplot, (Vector{Float64}, )) -precompile(scatterplot, (Vector{Float64}, Vector{Float64},)) -precompile(spy, (SparseMatrixCSC{Float64,Int64},)) -precompile(spy, (Matrix{Float64},)) -precompile(spy, (Matrix{Int64},)) -precompile(BrailleCanvas, (Int64, Int64,)) -precompile(AsciiCanvas, (Int64, Int64,)) -precompile(Plot, (BrailleCanvas,)) -precompile(Plot, (AsciiCanvas,)) -precompile(Plot, (Vector{Float64}, Vector{Float64}, Type{BrailleCanvas})) -precompile(Plot, (Vector{Float64}, Vector{Float64}, Type{AsciiCanvas})) -precompile(Base.show, (Base.TTY, Plot{BrailleCanvas})) -precompile(Base.show, (Base.TTY, Plot{AsciiCanvas})) -precompile(printrow, (Base.TTY, BrailleCanvas, Int64)) -precompile(printrow, (Base.TTY, AsciiCanvas, Int64))