KristofferC / NearestNeighbors.jl

High performance nearest neighbor data structures (KDTree and BallTree) and algorithms for Julia.
Other
413 stars 65 forks source link

Suggestion: Make KDTree interruptible #113

Closed colemanbroad closed 3 years ago

colemanbroad commented 3 years ago

In the REPL, I naively tried to build a KDTree on a 10_000x5 (NxP) array of points before realizing the implicit order should have been (PxN). The function did not return and was even unresponsive to holding Ctrl-C. I believe checking for such interrupt signals is the responsibility of the library, not the REPL? I believe this is likely to be a common beginners mistake, and thus it may make sense to check more frequently for interrupts?

I otherwise love the package. Simple interface, highly generic and blazing fast ;) Thank you.

KristofferC commented 3 years ago

I believe checking for such interrupt signals is the responsibility of the library, not the REPL

It is not. Julia itself checks the signal and throws an interrupt exception. However, there are only some places where this is possible. If you try to interrupt in a place where this isn't the case, it won't exit gracefully. There is nothing the package can do about that.