-
Notifications
You must be signed in to change notification settings - Fork 2
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
Voronoi #30 #46
Voronoi #30 #46
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really seeing why it's necessary to reimplement here?
src/algorithms/discretevoronoi.jl
Outdated
|
||
DiscreteVoronoi() = DiscreteVoronoi(3) | ||
|
||
function _landscape!(mat, alg::DiscreteVoronoi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this whole function just be
_landscape!(mat, alg::DiscreteVoronoi) = _landscape!(mat, NearestNeighborElement(alg.n, 1))
end of story?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. We probably don't need to reimplement. Just add in documentation that NearestNeighborElement
with k
set at 1 is voronoi-like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, I was just looking for a way to rasterize a Voronoi (#30). Now I know it's super easy using NearestNeighborElement
, we can close the issue 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah no, I think it's great to have a wrapper for this! i just wanted to reuse the function we already had. I think it should work if you edit the PR as suggested :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I wasn't clear what I meant by "reimplement"
src/algorithms/discretevoronoi.jl
Outdated
end | ||
end | ||
|
||
DiscreteVoronoi() = DiscreteVoronoi(3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just add 3 as a default value in the internal constructor in line 9?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh nice. I see
src/algorithms/discretevoronoi.jl
Outdated
""" | ||
DiscreteVoronoi | ||
|
||
Assigns a value to each patch using a 1-NN algorithmm with `n` initial clusters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't explain why it's called "Voronoi"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @virgile-baudrot looks good - thanks for the contribution!
Add Discrete Voronoi generation using NearestNeighborElement #30
Type of change
Please indicate the relevant option(s)
Checklist
.zenodo.json
Project.toml
fieldversion
has been updatedv0.0.x
series release, a bug fix, or a performance improvement