Changed from len(index.shape) to index.ndim

This commit is contained in:
Sebastian Kloth 2023-12-28 13:33:47 +01:00
parent 4a6c02627a
commit f2806ca3ca

View File

@ -99,9 +99,9 @@ def shifted_correlation(
return get_correlation(frames, start_frame, index, shifted_idx)
else:
index = selector(frames[start_frame])
if len(index.shape) == 1:
if index.ndim == 1:
return get_correlation(frames, start_frame, index, shifted_idx)
elif len(index.shape) == 2:
elif index.ndim == 2:
correlations = []
for ind in index:
correlations.append(
@ -110,7 +110,7 @@ def shifted_correlation(
return correlations
else:
raise ValueError(
f"Index list of selector has {len(index.shape)} dimensions, "
f"Index list of selector has {index.ndim} dimensions, "
"but should have 1 or 2"
)