Skip to content

Commit 1bc0937

Browse files
mathias-smlarsoner
andauthored
index is an array: use np.array_equal
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
1 parent 51f0b56 commit 1bc0937

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mne/utils/mixin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ def time_as_index(self, times, *, use_rounding=None):
537537
# "use_rounding=False explicitly to silence this warning.",
538538
# FutureWarning,
539539
# )
540-
if index != np.round(index):
540+
if not np.array_equal(index.astype(int), np.round(index))
541541
raise RuntimeError(
542542
f"This would have returned a different value: {index=}, different from {np.round(index)=}."
543543
)

0 commit comments

Comments
 (0)