Skip to content

Commit

Permalink
Change typeof(x) <: y to x isa y
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepijn de Vos committed Nov 2, 2023
1 parent ae1bda9 commit 99cd0e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/ensemblegpukernel/integrators/integrator_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ end
continuous_modified = false
discrete_modified = false
saved_in_cb = false
if !(typeof(continuous_callbacks) <: Tuple{})
if !(continuous_callbacks isa Tuple{})
event_occurred = false

time, upcrossing, event_occurred, event_idx, idx, counter = DiffEqBase.find_first_continuous_callback(integrator,
Expand All @@ -247,7 +247,7 @@ end
integrator.vector_event_last_time = 1
end
end
if !(typeof(discrete_callbacks) <: Tuple{})
if !(discrete_callbacks isa Tuple{})
discrete_modified, saved_in_cb = apply_discrete_callback!(integrator, ts, us,
discrete_callbacks...)
return discrete_modified, saved_in_cb
Expand Down
6 changes: 3 additions & 3 deletions src/solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ function SciMLBase.__solve(ensembleprob::SciMLBase.AbstractEnsembleProblem,

if cpu_trajectories != 0 && ensembleprob.reduction === SciMLBase.DEFAULT_REDUCTION
cpu_II = (gpu_trajectories + 1):trajectories
_alg = if typeof(alg) <: GPUODEAlgorithm
_alg = if alg isa GPUODEAlgorithm
if adaptive == false
cpu_alg[typeof(alg)][1]
else
cpu_alg[typeof(alg)][2]
end
elseif typeof(alg) <: GPUSDEAlgorithm
elseif alg isa GPUSDEAlgorithm
if adaptive == false
SimpleEM()
else
Expand Down Expand Up @@ -418,7 +418,7 @@ function solve_batch(prob, alg, ensemblealg::EnsembleThreads, II, pmap_batch_siz
kwargs...)
end

if typeof(prob.prob) <: SciMLBase.AbstractJumpProblem && length(II) != 1
if prob.prob isa SciMLBase.AbstractJumpProblem && length(II) != 1
probs = [deepcopy(prob.prob) for i in 1:Threads.nthreads()]
else
probs = prob.prob
Expand Down

0 comments on commit 99cd0e8

Please sign in to comment.