From 48a57bc5116bd5cb7e0ff247ac9ad7d8cfa394fa Mon Sep 17 00:00:00 2001 From: "femtocleaner[bot]" Date: Sun, 15 Jul 2018 00:41:54 +0000 Subject: [PATCH] Fix deprecations --- src/ODE.jl | 12 ++++++------ src/common.jl | 8 ++++---- test/interface-tests.jl | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ODE.jl b/src/ODE.jl index 2a7006fbb..5f59c7d90 100644 --- a/src/ODE.jl +++ b/src/ODE.jl @@ -159,8 +159,8 @@ function make_consistent_types(fn, y0, tspan, btab::Tableau) Eyf = Et end - !isleaftype(Et) && warn("The eltype(tspan) is not a concrete type! Change type of tspan for better performance.") - !isleaftype(Eyf) && warn("The eltype(y0/tspan[1]) is not a concrete type! Change type of y0 and/or tspan for better performance.") + !isconcretetype(Et) && @warn("The eltype(tspan) is not a concrete type! Change type of tspan for better performance.") + !isconcretetype(Eyf) && @warn("The eltype(y0/tspan[1]) is not a concrete type! Change type of y0 and/or tspan for better performance.") btab_ = convert(Et, btab) return Et, Eyf, Ty, btab_ @@ -269,8 +269,8 @@ function ode23s(F, y0, tspan; end # constants - const d = 1/(2 + sqrt(2)) - const e32 = 6 + sqrt(2) + d = 1/(2 + sqrt(2)) + e32 = 6 + sqrt(2) # initialization @@ -289,9 +289,9 @@ function ode23s(F, y0, tspan; h = tdir * min(abs(h), maxstep) y = y0 - tout = Vector{typeof(t)}(1) + tout = Vector{typeof(t)}(undef, 1) tout[1] = t # first output time - yout = Vector{typeof(y0)}(1) + yout = Vector{typeof(y0)}(undef, 1) yout[1] = deepcopy(y) # first output solution diff --git a/src/common.jl b/src/common.jl index b130e2cb0..f2983130e 100644 --- a/src/common.jl +++ b/src/common.jl @@ -23,11 +23,11 @@ function solve( if !(typeof(prob.f) <: DiffEqBase.AbstractParameterizedFunction) && typeof(alg) <: ode23s if DiffEqBase.has_tgrad(prob.f) - warn("Explicit t-gradient given to this stiff solver is ignored.") + @warn("Explicit t-gradient given to this stiff solver is ignored.") warned = true end if DiffEqBase.has_jac(prob.f) - warn("Explicit Jacobian given to this stiff solver is ignored.") + @warn("Explicit Jacobian given to this stiff solver is ignored.") warned = true end end @@ -35,7 +35,7 @@ function solve( end if save_timeseries != nothing - verbose && warn("save_timeseries is deprecated. Use save_everystep instead") + verbose && @warn("save_timeseries is deprecated. Use save_everystep instead") save_everystep = save_timeseries end @@ -110,7 +110,7 @@ function solve( # Reshape the result if needed if uType <: AbstractArray - timeseries = Vector{uType}(0) + timeseries = Vector{uType}() for i=start_idx:length(timeseries_tmp) push!(timeseries,reshape(timeseries_tmp[i],sizeu)) end diff --git a/test/interface-tests.jl b/test/interface-tests.jl index e241da2ea..d3a55c70c 100644 --- a/test/interface-tests.jl +++ b/test/interface-tests.jl @@ -13,7 +13,7 @@ const g0 = 0. # define custom type ... struct CompSol - rho::Matrix{Complex128} + rho::Matrix{ComplexF64} x::Float64 p::Float64 @@ -74,7 +74,7 @@ for solver in solvers if solver in [ODE.ode23s, ODE.ode4s_s, ODE.ode4s_kr] continue end - t,y2 = solver((t,y)->rhs(t, y, delta0, V0, g0), y0, linspace(0., endt, 500)) + t,y2 = solver((t,y)->rhs(t, y, delta0, V0, g0), y0, range(0., stop=endt, length=500)) @test norm(y1[end]-y2[end])<0.15 end println("ok.")