Skip to content

Commit 6317bf5

Browse files
asbisenstevengj
authored andcommitted
Fix @warn deprecation and runtests for v1.0.0 (#373)
* Fix @warn deprecation and runtests for v1.0.0 Modified @warn -> Compat.@warn Conditionally import Base64 based on julia version Added Compat to runtests.jl Replacing linspace with range for VERSION >= 0.7.0 Commented out last test in runtests.jl Fixed commented output in runtests.jl * Replace range/linspace with explicit range * Reverted collect() due to PyCall issue #533 * Update init.jl
1 parent c16484b commit 6317bf5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/init.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function find_backend(matplotlib::PyObject)
157157
end
158158
catch e
159159
if !isjulia_display[1]
160-
warn("No working GUI backend found for matplotlib")
160+
Compat.@warn("No working GUI backend found for matplotlib")
161161
isjulia_display[1] = true
162162
end
163163
pygui(:default)

test/runtests.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
ENV["MPLBACKEND"]="agg" # no GUI
22

33
using PyPlot, PyCall
4+
using Compat
5+
6+
VERSION >= v"0.7.0" && using Base64
47

58
if isdefined(Base, :Test) && !Base.isdeprecated(Base, :Test)
69
using Base.Test
@@ -22,16 +25,17 @@ s = stringmime("application/postscript", fig);
2225
m = match(r"%%BoundingBox: *([0-9]+) +([0-9]+) +([0-9]+) +([0-9]+)", s)
2326
@test m !== nothing
2427
boundingbox = map(s -> parse(Int, s), m.captures)
25-
info("got plot bounding box ", boundingbox)
28+
Compat.@info("got plot bounding box ", boundingbox)
2629
@test all([300, 200] .< boundingbox[3:4] - boundingbox[1:2] .< [450,350])
2730

2831
c = get_cmap("viridis")
29-
a = linspace(0,1,5)
32+
a = 0.0:0.25:1.0
33+
34+
3035
rgba = pycall(pycall(PyPlot.ScalarMappable, PyObject, cmap=c,
3136
norm=PyPlot.Normalize01)["to_rgba"], PyArray, a)
3237
@test rgba [ 0.267004 0.004874 0.329415 1.0
3338
0.229739 0.322361 0.545706 1.0
3439
0.127568 0.566949 0.550556 1.0
3540
0.369214 0.788888 0.382914 1.0
3641
0.993248 0.906157 0.143936 1.0 ]
37-

0 commit comments

Comments
 (0)