We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dd092dd commit ce68f0aCopy full SHA for ce68f0a
1 file changed
synctoolbox/dtw/utils.py
@@ -225,14 +225,16 @@ def find_anchor_indices_in_warping_path(warping_path: np.ndarray,
225
226
Returns
227
-------
228
- indices : np.ndarray [shape=(2, M)]
+ indices : np.ndarray [shape=(M,)]
229
Anchor indices in the ``warping_path``
230
"""
231
indices = np.zeros(anchors.shape[1], dtype=int)
232
233
for k in range(anchors.shape[1]):
234
a = anchors[:, k]
235
anchor_indices = np.flatnonzero((a[0] == warping_path[0, :]) & (a[1] == warping_path[1, :]))
236
+ if anchor_indices.size == 0:
237
+ raise ValueError(f"Anchor {a.tolist()} not found in warping path")
238
indices[k] = anchor_indices[0]
239
240
return indices
0 commit comments