Skip to content

Commit cb89140

Browse files
workaround v0.5.2 bug
1 parent 0df3f7b commit cb89140

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/solutions/solution_interface.jl

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ function done(sol::AbstractTimeseriesSolution,state)
4141
state >= length(sol)
4242
end
4343

44-
const DEFAULT_PLOT_FUNC = (x...) -> (x...)
44+
DEFAULT_PLOT_FUNC(x...) = (x...)
45+
DEFAULT_PLOT_FUNC(x,y,z) = (x,y,z) # For v0.5.2 bug
4546

4647
@recipe function f(sol::AbstractTimeseriesSolution;
4748
plot_analytic=false,
@@ -309,8 +310,24 @@ function solplot_vecs_and_labels(dims,vars,plot_timeseries,plott,sol,plot_analyt
309310
end
310311

311312
f = x[1]
312-
tmp = f.(tmp...)
313313

314+
if VERSION < v"0.6-" && length(tmp) == 3
315+
# Work around bug
316+
#=
317+
f = (x...) -> x
318+
test = Any[rand(5),rand(5)]
319+
f.(test...)
320+
test = Any[rand(5),rand(5),rand(5)]
321+
f.(test...)
322+
=#
323+
res = Any[]
324+
for i in eachindex(tmp[1])
325+
push!(res,(tmp[1][i],tmp[2][i],tmp[3][i]))
326+
end
327+
tmp = res
328+
else
329+
tmp = f.(tmp...)
330+
end
314331

315332
tmp = tuple((getindex.(tmp,i) for i in eachindex(tmp[1]))...)
316333
for i in eachindex(tmp)

0 commit comments

Comments
 (0)