Skip to content

Commit

Permalink
Merge pull request #132 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 7336ef0 + 43405cb commit 7cce7fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/morris_sensitivity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ function gsa(f, method::Morris, p_range::AbstractVector; batch = false,
y1 = multioutput ? all_y[:, j + 1] : all_y[j + 1]
if relative_scale == false
effect = @. (y1 - y2) / (del)
elem_effect = typeof(y1) <: Number ? effect : mean(effect, dims = 2)
elem_effect = y1 isa Number ? effect : mean(effect, dims = 2)
else
if del > 0
effect = @. (y1 - y2) / (y2 * del)
elem_effect = typeof(y1) <: Number ? effect : mean(effect, dims = 2)
elem_effect = y1 isa Number ? effect : mean(effect, dims = 2)
else
effect = @. (y1 - y2) / (y1 * del)
elem_effect = typeof(y1) <: Number ? effect : mean(effect, dims = 2)
elem_effect = y1 isa Number ? effect : mean(effect, dims = 2)
end
end
if length(effects) >= change_index && change_index > 0
Expand Down

0 comments on commit 7cce7fd

Please sign in to comment.