Skip to content

Commit

Permalink
Error if window greater than dataset size in all_neighbors (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
denizhanpak committed Sep 22, 2023
1 parent 9a0bbfe commit 1f4caec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function all_neighbors(vtree, vs, ns, K, w)
end

function all_neighbors(A::AbstractStateSpaceSet, stype, w::Int = 0)
w length(A)-1 && error("Theiler window larger than the entire data span!")
theiler = Theiler(w)
tree = KDTree(A)
idxs, dists = bulksearch(tree, A, stype, theiler)
Expand Down

0 comments on commit 1f4caec

Please sign in to comment.