Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Fix deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
femtocleaner[bot] committed Jul 15, 2018
1 parent 20b3ac5 commit 48a57bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/ODE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down Expand Up @@ -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
Expand All @@ -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


Expand Down
8 changes: 4 additions & 4 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ 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
warned && warn_compat()
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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions test/interface-tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const g0 = 0.

# define custom type ...
struct CompSol
rho::Matrix{Complex128}
rho::Matrix{ComplexF64}
x::Float64
p::Float64

Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 48a57bc

Please sign in to comment.