Skip to content

Commit 7ee0fc6

Browse files
committed
Fix type comparison
1 parent 3a7e6d3 commit 7ee0fc6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

mne/io/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,7 +3167,11 @@ def _write_raw_buffer(fid, buf, cals, fmt):
31673167
def _check_raw_compatibility(raw):
31683168
"""Ensure all instances of Raw have compatible parameters."""
31693169
for ri in range(1, len(raw)):
3170-
_validate_type(raw[ri], BaseRaw, f"raw[{ri}]")
3170+
if not isinstance(raw[ri], (BaseRaw, _RawShell)):
3171+
raise ValueError(
3172+
f"raw[{ri}] type must match raw[0]: expected BaseRaw, got "
3173+
f"{type(raw[ri]).__name__}"
3174+
)
31713175
for key in ("nchan", "sfreq"):
31723176
a, b = raw[ri].info[key], raw[0].info[key]
31733177
if a != b:
@@ -3180,7 +3184,7 @@ def _check_raw_compatibility(raw):
31803184
mismatch = set1.symmetric_difference(set2)
31813185
if mismatch:
31823186
raise ValueError(
3183-
f"raw[{ri}]['info'][{kind}] do not match: {sorted(mismatch)}"
3187+
f"raw[{ri}].info[{kind}] must match: {sorted(mismatch)}"
31843188
)
31853189
if any(raw[ri]._cals != raw[0]._cals):
31863190
raise ValueError(f"raw[{ri}]._cals must match")

0 commit comments

Comments
 (0)