Skip to content

Commit

Permalink
Merge pull request #5 from briochemc/nonuniqueknots
Browse files Browse the repository at this point in the history
Fix non unique knots for intersections
  • Loading branch information
briochemc authored May 8, 2021
2 parents ef8d51b + 937abc7 commit 0fa860a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "OceanGrids"
uuid = "cfe838f4-859f-11e9-2ea1-df7d4e7c3537"
authors = ["Benoit Pasquier <[email protected]>"]
version = "0.3.5"
version = "0.3.6"

[deps]
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Expand Down
10 changes: 6 additions & 4 deletions src/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,12 @@ function intersections(x::AbstractArray{T}, y, ylevs) where T
mini_y = view(y, i:i+1)
idx = sortperm(mini_y)
a, b = view(mini_y, idx)
itp = LinearInterpolation(mini_y[idx], mini_x[idx], extrapolation_bc=Line())
for x_intersect in itp(ylevs[a .< ylevs .≤ b])
push!(out, x_intersect)
end
if a b
itp = LinearInterpolation(mini_y[idx], mini_x[idx], extrapolation_bc=Line())
for x_intersect in itp(ylevs[a .< ylevs .≤ b])
push!(out, x_intersect)
end
end
end
return out
end
Expand Down

2 comments on commit 0fa860a

@briochemc
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/36325

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.3.6 -m "<description of version>" 0fa860a3c574667946abe80f885a2b2de09506e0
git push origin v0.3.6

Please sign in to comment.