Repository: mne-tools/mne-python

Issue:
split raw file error in examples/decoding/decoding_rsa_sgskip.py
while executing line 83 - 84: raws = [read_raw_fif(fname, verbose='error') for fname in fnames]  this error pops up:

```


Traceback (most recent call last):
  File "C:\Users\Carina\Documents\expecon_EEG_analysis\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3361, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-28-5f4d8359a1fd>", line 1, in <cell line: 1>
    raws = [read_raw_fif(fname, verbose='error')
  File "<ipython-input-28-5f4d8359a1fd>", line 1, in <listcomp>
    raws = [read_raw_fif(fname, verbose='error')
  File "C:\Users\Carina\Documents\expecon_EEG_analysis\venv\lib\site-packages\mne\io\fiff\raw.py", line 482, in read_raw_fif
    return Raw(fname=fname, allow_maxshield=allow_maxshield,
  File "<decorator-gen-240>", line 10, in __init__
  File "C:\Users\Carina\Documents\expecon_EEG_analysis\venv\lib\site-packages\mne\io\fiff\raw.py", line 94, in __init__
    _on_missing(on_split_missing, msg, name='on_split_missing')
  File "C:\Users\Carina\Documents\expecon_EEG_analysis\venv\lib\site-packages\mne\utils\check.py", line 872, in _on_missing
    raise error_klass(msg)
ValueError: Split raw file detected but next file C:\Users\Carina\mne_data\MNE-visual_92_categories-data\sample_subject_0_tsss_mc-1.fif does not exist. Ensure all files were transferred properly and that split and original files were not manually renamed on disk (split files should be renamed by loading and re-saving with MNE-Python to preserve proper filename linkage).
```






Discussion:
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽‍♂️

I've reproduced this locally on current `main`
it seems that the visual_92 data files have a `FIFF_REF_FILE_NUM` tag but don't actually have subsequent files (?).  This dataset is only actually used in 2 places in our docs, and both are `_sgskip` files so they never actually get executed/tested. Here are the lines where the tag gets matched and triggers `next_fname` to not be `None`:

https://github.com/mne-tools/mne-python/blob/23a8da684a4debe87b8de99dda6fba399ac22063/mne/io/open.py#L73-L91

I'm not sure how to dig deeper; I don't know much about the origin of that dataset (or how things like split files are encoded in the FIFF standard)
I can replicate the pb. Only one file was shared with me years ago. Just do:

```
raws = [read_raw_fif(fname % block, verbose='error', on_split_missing='ignore')
        for block in range(n_runs)]  # ignore filename warnings
```

in the script. Any volunteer to send the PR?
this wasn't actually fixed yet, as the linked PR wasn't merged. reopening.

Resolving patch:
diff --git a/examples/decoding/decoding_rsa_sgskip.py b/examples/decoding/decoding_rsa_sgskip.py
--- a/examples/decoding/decoding_rsa_sgskip.py
+++ b/examples/decoding/decoding_rsa_sgskip.py
@@ -78,9 +78,8 @@
 ##############################################################################
 # Read MEG data
 n_runs = 4  # 4 for full data (use less to speed up computations)
-fnames = [data_path / 'sample_subject_{}_tsss_mc.fif'.format(b)
-          for b in range(n_runs)]
-raws = [read_raw_fif(fname, verbose='error')
+fnames = [data_path / f'sample_subject_{b}_tsss_mc.fif' for b in range(n_runs)]
+raws = [read_raw_fif(fname, verbose='error', on_split_missing='ignore')
         for fname in fnames]  # ignore filename warnings
 raw = concatenate_raws(raws)
 


Test patch: