From 3cc0d0c735095f3cc59ba73a3a8958494b8ff4b1 Mon Sep 17 00:00:00 2001 From: Daniel Schwabeneder Date: Wed, 4 Jul 2018 21:10:08 +0200 Subject: [PATCH] Revert "Fix deprecations" --- src/args.jl | 1 - src/backends/glvisualize.jl | 2 +- src/backends/hdf5.jl | 2 +- src/backends/inspectdr.jl | 8 ++++---- src/backends/pyplot.jl | 24 ++++++++++++------------ src/components.jl | 3 --- src/series.jl | 2 +- src/utils.jl | 1 - test/imgcomp.jl | 1 - 9 files changed, 19 insertions(+), 25 deletions(-) diff --git a/src/args.jl b/src/args.jl index d9e41569..671485d0 100644 --- a/src/args.jl +++ b/src/args.jl @@ -654,7 +654,6 @@ function handleColors!(d::KW, arg, csym::Symbol) d[csym] = c end return true - catch end false end diff --git a/src/backends/glvisualize.jl b/src/backends/glvisualize.jl index b9b2099c..b8a4ed04 100644 --- a/src/backends/glvisualize.jl +++ b/src/backends/glvisualize.jl @@ -80,7 +80,7 @@ function _initialize_backend(::GLVisualizeBackend; kw...) is_marker_supported(::GLVisualizeBackend, shape::GLVisualize.AllPrimitives) = true is_marker_supported(::GLVisualizeBackend, shape::Union{Vector{Matrix{C}}, Matrix{C}}) where {C<:Colorant} = true is_marker_supported(::GLVisualizeBackend, shape::Shape) = true - GL = Plots + const GL = Plots end end diff --git a/src/backends/hdf5.jl b/src/backends/hdf5.jl index 52238146..a82a277f 100644 --- a/src/backends/hdf5.jl +++ b/src/backends/hdf5.jl @@ -146,7 +146,7 @@ function _initialize_backend(::HDF5Backend) export HDF5 if length(HDF5PLOT_MAP_TELEM2STR) < 1 #Possible element types of high-level data types: - telem2str = Dict{String, Type}( + const telem2str = Dict{String, Type}( "NATIVE" => HDF5PlotNative, "VOID" => Void, "BOOL" => Bool, diff --git a/src/backends/inspectdr.jl b/src/backends/inspectdr.jl index 32384481..8cc2a22c 100644 --- a/src/backends/inspectdr.jl +++ b/src/backends/inspectdr.jl @@ -166,7 +166,7 @@ function _initialize_backend(::InspectDRBackend; kw...) export InspectDR #Glyph used when plotting "Shape"s: - INSPECTDR_GLYPH_SHAPE = InspectDR.GlyphPolyline( + const INSPECTDR_GLYPH_SHAPE = InspectDR.GlyphPolyline( 2*InspectDR.GLYPH_SQUARE.x, InspectDR.GLYPH_SQUARE.y ) @@ -347,8 +347,8 @@ end # --------------------------------------------------------------------------- function _inspectdr_setupsubplot(sp::Subplot{InspectDRBackend}) - plot = sp.o - strip = plot.strips[1] #Only 1 strip supported with Plots.jl + const plot = sp.o + const strip = plot.strips[1] #Only 1 strip supported with Plots.jl xaxis = sp[:xaxis]; yaxis = sp[:yaxis] xgrid_show = xaxis[:grid] @@ -406,7 +406,7 @@ end # called just before updating layout bounding boxes... in case you need to prep # for the calcs function _before_layout_calcs(plt::Plot{InspectDRBackend}) - mplot = _inspectdr_getmplot(plt.o) + const mplot = _inspectdr_getmplot(plt.o) if nothing == mplot; return; end mplot.title = plt[:plot_title] diff --git a/src/backends/pyplot.jl b/src/backends/pyplot.jl index b6b4d023..fa86acc3 100644 --- a/src/backends/pyplot.jl +++ b/src/backends/pyplot.jl @@ -82,21 +82,21 @@ function _initialize_backend(::PyPlotBackend) append!(Base.Multimedia.displays, otherdisplays) export PyPlot - pycolors = PyPlot.pyimport("matplotlib.colors") - pypath = PyPlot.pyimport("matplotlib.path") - mplot3d = PyPlot.pyimport("mpl_toolkits.mplot3d") - pypatches = PyPlot.pyimport("matplotlib.patches") - pyfont = PyPlot.pyimport("matplotlib.font_manager") - pyticker = PyPlot.pyimport("matplotlib.ticker") - pycmap = PyPlot.pyimport("matplotlib.cm") - pynp = PyPlot.pyimport("numpy") + const pycolors = PyPlot.pyimport("matplotlib.colors") + const pypath = PyPlot.pyimport("matplotlib.path") + const mplot3d = PyPlot.pyimport("mpl_toolkits.mplot3d") + const pypatches = PyPlot.pyimport("matplotlib.patches") + const pyfont = PyPlot.pyimport("matplotlib.font_manager") + const pyticker = PyPlot.pyimport("matplotlib.ticker") + const pycmap = PyPlot.pyimport("matplotlib.cm") + const pynp = PyPlot.pyimport("numpy") pynp["seterr"](invalid="ignore") - pytransforms = PyPlot.pyimport("matplotlib.transforms") - pycollections = PyPlot.pyimport("matplotlib.collections") - pyart3d = PyPlot.art3D + const pytransforms = PyPlot.pyimport("matplotlib.transforms") + const pycollections = PyPlot.pyimport("matplotlib.collections") + const pyart3d = PyPlot.art3D # "support" matplotlib v1.5 - set_facecolor_sym = if PyPlot.version < v"2" + const set_facecolor_sym = if PyPlot.version < v"2" warn("You are using Matplotlib $(PyPlot.version), which is no longer officialy supported by the Plots community. To ensure smooth Plots.jl integration update your Matplotlib library to a version >= 2.0.0") :set_axis_bgcolor else diff --git a/src/components.jl b/src/components.jl index 1953d1f6..2b1284ce 100644 --- a/src/components.jl +++ b/src/components.jl @@ -69,7 +69,6 @@ function weave(x,y; ordering = Vector[x,y]) for o in ordering try push!(ret, shift!(o)) - catch end end done = isempty(x) && isempty(y) @@ -389,7 +388,6 @@ function stroke(args...; alpha = nothing) elseif T <: Symbol || T <: AbstractString try color = parse(Colorant, string(arg)) - catch end elseif allAlphas(arg) alpha = arg @@ -422,7 +420,6 @@ function brush(args...; alpha = nothing) elseif T <: Symbol || T <: AbstractString try color = parse(Colorant, string(arg)) - catch end elseif allAlphas(arg) alpha = arg diff --git a/src/series.jl b/src/series.jl index 44552aab..9af76774 100644 --- a/src/series.jl +++ b/src/series.jl @@ -46,7 +46,7 @@ convertToAnyVector(v::Volume, d::KW) = Any[v], nothing # convertToAnyVector(v::AVec{OHLC}, d::KW) = Any[v], nothing # # dates -convertToAnyVector(dts::AVec{D}, d::KW) where {D<:Union{Date,DateTime}} = Any[dts], nothing +convertToAnyVector{D<:Union{Date,DateTime}}(dts::AVec{D}, d::KW) = Any[dts], nothing # list of things (maybe other vectors, functions, or something else) function convertToAnyVector(v::AVec, d::KW) diff --git a/src/utils.jl b/src/utils.jl index 895c66c5..2334d96a 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -307,7 +307,6 @@ function _expand_limits(lims, x) lims[2] = NaNMath.max(lims[2], e2) # catch err # warn(err) - catch end nothing end diff --git a/test/imgcomp.jl b/test/imgcomp.jl index 69810fe5..625d6d77 100644 --- a/test/imgcomp.jl +++ b/test/imgcomp.jl @@ -10,7 +10,6 @@ ENV["MPLBACKEND"] = "Agg" try @eval import PyPlot info("Matplotlib version: $(PyPlot.matplotlib[:__version__])") -catch end