Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added inPolygon with tests #82

Merged
merged 2 commits into from
Mar 6, 2024
Merged

Conversation

ArneSpang
Copy link
Collaborator

Added inpolygon function which is needed for the setup generation of Tatjana/Andrea

boriskaus
boriskaus previously approved these changes Mar 6, 2024
src/utils.jl Outdated
Checks if points given by matrices `X` and `Y` are in or on (both cases return true) a polygon given by `PolyX` and `PolyY`. Boolean `fast` will trigger faster version that may miss points that are exactly on the edge of the polygon. Speedup is a factor of 3.

"""
function inPolygon!(PolyX::Vector{T}, PolyY::Vector{T}, X::Matrix{T}, Y::Matrix{T}, INSIDE::Matrix{Bool}; fast=false) where T <: Real
Copy link
Member

Choose a reason for hiding this comment

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

the naming convention for in-place Julia functions is that the array that is being changed should be listed first.
So this should be renamed as:

function inPolygon!(INSIDE::Matrix{Bool}, PolyX::Vector{T}, PolyY::Vector{T}, X::Matrix{T}, Y::Matrix{T}; fast=false) where T <: Real

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed it around but now one of the tests failed. It says it is in IO and sounds like a network problem of the test server. Do you understand what is going on there?
image

Copy link
Member

Choose a reason for hiding this comment

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

yes, we have this frequently. Downloading remote data is sometimes fragile. restarting the CI often solves it.

@boriskaus boriskaus dismissed their stale review March 6, 2024 15:02

I accidentally approved; the input to the function should be renamed

Copy link
Member

@boriskaus boriskaus left a comment

Choose a reason for hiding this comment

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

the input to the inPolygon! function should be changed

@boriskaus boriskaus merged commit 448082f into JuliaGeodynamics:main Mar 6, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants