diff --git a/NEWS.md b/NEWS.md index 10378f0f..2ef59484 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,12 @@ ## (current master) - All new development should target Julia 1.x! +## 0.19.2 +- several small fixes for 1.0 compatibility + +## 0.19.1 +- don't broadcast plot_color + ## 0.19.0 - Refactor conditional loading to use Requires - Many fixes for 1.0 compatibility diff --git a/src/backends.jl b/src/backends.jl index 7f5bcd77..d6dc3bea 100644 --- a/src/backends.jl +++ b/src/backends.jl @@ -400,7 +400,10 @@ function add_backend_string(::PyPlotBackend) """ using Pkg Pkg.add("PyPlot") + Pkg.add("PyCall") + Pkg.add("LaTeXStrings") withenv("PYTHON" => "") do + Pkg.build("PyCall") Pkg.build("PyPlot") end """ diff --git a/src/backends/hdf5.jl b/src/backends/hdf5.jl index 2c6b3ecb..8389c496 100644 --- a/src/backends/hdf5.jl +++ b/src/backends/hdf5.jl @@ -41,6 +41,7 @@ end #==Useful constants ===============================================================================# +const _hdf5_nullable{T} = Union{T, Nothing} const _hdf5_plotroot = "plot" const _hdf5_dataroot = "data" #TODO: Eventually move data to different root (easier to locate)? const _hdf5plot_datatypeid = "TYPE" #Attribute identifying type @@ -129,7 +130,7 @@ if length(HDF5PLOT_MAP_TELEM2STR) < 1 "AXIS" => Axis, "SURFACE" => Surface, "SUBPLOT" => Subplot, - "NULLABLE" => Nullable, + "NULLABLE" => _hdf5_nullable, ) merge!(HDF5PLOT_MAP_STR2TELEM, telem2str) merge!(HDF5PLOT_MAP_TELEM2STR, Dict{Type, String}(v=>k for (k,v) in HDF5PLOT_MAP_STR2TELEM)) @@ -344,9 +345,10 @@ function _hdf5plot_gwritearray(grp, k::String, v::Array{T}) where T vgrp = HDF5.g_create(grp, k) _hdf5plot_writetype(vgrp, Array) #ANY sz = size(v) + lidx = LinearIndices(sz) for iter in eachindex(v) - coord = LinearIndices(sz, iter) + coord = lidx[iter] elem = v[iter] idxstr = join(coord, "_") _hdf5plot_gwrite(vgrp, "v$idxstr", v[iter]) @@ -391,7 +393,7 @@ function _hdf5plot_gwrite(grp, k::String, v::Surface) _hdf5plot_writetype(grp, Surface) end # #TODO: "Properly" support Nullable using _hdf5plot_writetype? -# function _hdf5plot_gwrite(grp, k::String, v::Nullable) +# function _hdf5plot_gwrite(grp, k::String, v::_hdf5_nullable) # if isnull(v) # _hdf5plot_gwrite(grp, k, nothing) # else @@ -508,10 +510,11 @@ function _hdf5plot_read(grp, k::String, T::Type{Array}, dtid) #ANY sz = _hdf5plot_read(grp, "dim") if [0] == sz; return []; end sz = tuple(sz...) - result = Array{Any}(sz) + result = Array{Any}(undef, sz) + lidx = LinearIndices(sz) for iter in eachindex(result) - coord = LinearIndices(sz, iter) + coord = lidx[iter] idxstr = join(coord, "_") result[iter] = _hdf5plot_read(grp, "v$idxstr") end diff --git a/src/backends/plotly.jl b/src/backends/plotly.jl index 51c24c85..810a5e88 100644 --- a/src/backends/plotly.jl +++ b/src/backends/plotly.jl @@ -645,7 +645,7 @@ end function plotly_series_shapes(plt::Plot, series::Series) segments = iter_segments(series) - d_outs = Vector{KW}(length(segments)) + d_outs = Vector{KW}(undef, length(segments)) # TODO: create a d_out for each polygon # x, y = series[:x], series[:y] @@ -707,7 +707,7 @@ function plotly_series_segments(series::Series, d_base::KW, x, y, z) (isa(series[:fillrange], AbstractVector) || isa(series[:fillrange], Tuple)) segments = iter_segments(series) - d_outs = Vector{KW}((hasfillrange ? 2 : 1 ) * length(segments)) + d_outs = Vector{KW}(undef, (hasfillrange ? 2 : 1 ) * length(segments)) for (i,rng) in enumerate(segments) !isscatter && length(rng) < 2 && continue diff --git a/src/backends/plotlyjs.jl b/src/backends/plotlyjs.jl index 1482b717..127aef52 100644 --- a/src/backends/plotlyjs.jl +++ b/src/backends/plotlyjs.jl @@ -38,7 +38,7 @@ function _series_updated(plt::Plot{PlotlyJSBackend}, series::Series) end PlotlyJS.restyle!( plt.o, - findfirst(plt.series_list, series), + findfirst(isequal(series), plt.series_list), kw ) end diff --git a/src/plot.jl b/src/plot.jl index 9d0ee6c4..ccce63d1 100644 --- a/src/plot.jl +++ b/src/plot.jl @@ -283,11 +283,11 @@ end function plot(sp::Subplot, args...; kw...) plt = sp.plt - plot(plt, args...; kw..., subplot = findfirst(plt.subplots, sp)) + plot(plt, args...; kw..., subplot = findfirst(isequal(sp), plt.subplots)) end function plot!(sp::Subplot, args...; kw...) plt = sp.plt - plot!(plt, args...; kw..., subplot = findfirst(plt.subplots, sp)) + plot!(plt, args...; kw..., subplot = findfirst(isequal(sp), plt.subplots)) end # -------------------------------------------------------------------- diff --git a/src/plotattr.jl b/src/plotattr.jl index 7313b2ce..42e3edf5 100644 --- a/src/plotattr.jl +++ b/src/plotattr.jl @@ -46,7 +46,7 @@ function plotattr(attrtype::Symbol, attribute::AbstractString) attribute = Symbol(lookup_aliases(attrtype, attribute)) desc = get(_arg_desc, attribute, "") - first_period_idx = findfirst(desc, '.') + first_period_idx = findfirst(isequal('.'), desc) typedesc = desc[1:first_period_idx-1] desc = strip(desc[first_period_idx+1:end]) als = keys(filter((_,v)->v==attribute, _keyAliases)) |> collect |> sort