-
Notifications
You must be signed in to change notification settings - Fork 66
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
Initialize indices with 1
, allows for Infs and NaNs in the data
#126
base: master
Are you sure you want to change the base?
Conversation
Tried out NaN on data, and turns out in that case we still have problems. Hard to figure out what to do in that case, will need more work, not as easy as this patch. Left a commented test for that issue. |
@@ -31,6 +16,21 @@ end | |||
end | |||
end | |||
|
|||
# # Test for issue #78 |
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.
Not sure why you commented this out,
but if its merely because the test fails, a @test_broken
might be appropriate so we know its broken :)
The patch merely modifies the algorithm to initialize the index list with
1
instead of-1
. New tests are added that reproduce issues #78 and #125.It's a bit of a decision what to do with NaNs, in my opinion it's best if we ensure indices are always valid, and a NaN distance is as good as Inf.