Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pysyncon/robust.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ def _sv_decomposition(
if not threshold and not sv_count:
raise ValueError("One of `threshold` or `sv_count` must be supplied.")
u, s, v = np.linalg.svd(Y)
s_shape = s.shape[0] - 1
if threshold:
idx = 0
while s[idx] > threshold:
while s[idx] > threshold and idx < s_shape:
idx += 1
else:
idx = sv_count
Expand Down