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

Commit

Permalink
Merge pull request #181 from pepijndevos/new-branch
Browse files Browse the repository at this point in the history
Change typeof(x) <: y to x isa y
  • Loading branch information
ChrisRackauckas authored Nov 2, 2023
2 parents cce8f35 + ee2034d commit 3355199
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function solve(
saveat=eltype(tupType)[], reltol = 1e-5, abstol = 1e-8,
save_everystep=isempty(saveat),
dense = save_everystep && isempty(saveat),
save_start = save_everystep || isempty(saveat) || typeof(saveat) <: Number ?
save_start = save_everystep || isempty(saveat) || saveat isa Number ?
true : prob.tspan[1] in saveat,
callback=nothing,
dtmin = abs(prob.tspan[2]-prob.tspan[1])/1e-9,
Expand All @@ -20,8 +20,8 @@ function solve(

if verbose
warned = !isempty(kwargs) && check_keywords(alg, kwargs, warnlist)
if !(typeof(prob.f) <: DiffEqBase.AbstractParameterizedFunction) &&
typeof(alg) <: ode23s
if !(prob.f isa DiffEqBase.AbstractParameterizedFunction) &&
alg isa ode23s
if DiffEqBase.has_tgrad(prob.f)
@warn("Explicit t-gradient given to this stiff solver is ignored.")
warned = true
Expand Down Expand Up @@ -49,7 +49,7 @@ function solve(

tspan = prob.tspan

if typeof(saveat) <: Number
if saveat isa Number
if (tspan[1]:saveat:tspan[end])[end] == tspan[end]
saveat_vec = convert(Vector{tType},collect(tType,tspan[1]+saveat:saveat:tspan[end]))
else
Expand Down
2 changes: 1 addition & 1 deletion test/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ prob = prob_ode_linear

for alg in algs
sol =solve(prob,alg;dt=dt,abstol=1e-6,reltol=1e-3)
@test typeof(sol[2]) <: Number
@test sol[2] isa Number
end

prob = prob_ode_2Dlinear
Expand Down

0 comments on commit 3355199

Please sign in to comment.