Bug in Epochs.save() and Raw.save()

Dear mne Forum.
-Using mne 1.4.0

My EEG data is of the persyst type, mne.io.read_raw_persyst().
I created fixed length epochs of 30 seconds and want to save them in my files.

I got an error when saving, the same error occures when i tried to save the raw_preprocessed file.
epochs.save('epochs_epo.fif', overwrite = True)

The error:

AssertionError                            Traceback (most recent call last)
Cell In[60], line 1
----> 1 epochs.save('epochs_epo.fif', overwrite = True)

File :12, in save(self, fname, split_size, fmt, overwrite, split_naming, verbose)

File c:\Users\arons\anaconda_New3\envs\mne\lib\site-packages\mne\epochs.py:2153, in BaseEpochs.save(self, fname, split_size, fmt, overwrite, split_naming, verbose)
   2151 # avoid missing event_ids in splits
   2152 this_epochs.event_id = self.event_id
-> 2153 _save_split(
   2154     this_epochs, fname, part_idx, n_parts, fmt, split_naming, overwrite
   2155 )

File c:\Users\arons\anaconda_New3\envs\mne\lib\site-packages\mne\epochs.py:150, in _save_split(epochs, fname, part_idx, n_parts, fmt, split_naming, overwrite)
    147     next_idx = None
    149 with start_and_end_file(fname) as fid:
--> 150     _save_part(fid, epochs, fmt, n_parts, next_fname, next_idx)

File c:\Users\arons\anaconda_New3\envs\mne\lib\site-packages\mne\epochs.py:163, in _save_part(fid, epochs, fmt, n_parts, next_fname, next_idx)
    160     write_id(fid, FIFF.FIFF_PARENT_BLOCK_ID, info["meas_id"])
    162 # Write measurement info
--> 163 write_meas_info(fid, info)
    165 # One or more evoked data sets
    166 start_block(fid, FIFF.FIFFB_PROCESSED_DATA)
...
--> 121     assert len(data) == 3
    122     data_size = 4
    123     jd = np.sum(_cal_to_julian(*data))

AssertionError: 
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...```

The error occurs with the assert len(data) == 3

Is this a bug in the `Epochs.save()` format? The same error occurs when i tried saving the raw via `raw.save()`

Thanks in advance.

Kind regards,
Aron Segers

Translating the error: “I expected epochs.get_data() to be an array with 3 dimensions, but it isn’t, and now I don’t know what to do”.

Could you check whether epochs.get_data().shape makes sense? It could be a bug somewhere else.

If i run the epochs.get_data().shape I get a 3-dimensional array. Maybe there is a bug somewhere else than? I pasted my code and the error i recieved again

epochs = mne.make_fixed_length_epochs(raw_eeg_cropped, duration=30, preload= True)
print(f'The shape of the epochs array : {epochs.get_data().shape}')
epochs.save('epochs-epo.fif')
Not setting metadata
180 matching events found
No baseline correction applied
Created an SSP operator (subspace dimension = 1)
1 projection items activated
Using data from preloaded Raw for 180 events and 7680 original time points ...
0 bad epochs dropped
The shape of the epochs array : (180, 37, 7680)
Overwriting existing file.

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
Cell In[25], line 3
      1 epochs = mne.make_fixed_length_epochs(raw_eeg_cropped, duration=30, preload= True)
      2 print(f'The shape of the epochs array : {epochs.get_data().shape}')
----> 3 epochs.save('epochs-epo.fif', overwrite = True)

File :12, in save(self, fname, split_size, fmt, overwrite, split_naming, verbose)

File c:\Users\arons\anaconda_New3\envs\mne\lib\site-packages\mne\epochs.py:2153, in BaseEpochs.save(self, fname, split_size, fmt, overwrite, split_naming, verbose)
   2151 # avoid missing event_ids in splits
   2152 this_epochs.event_id = self.event_id
-> 2153 _save_split(
   2154     this_epochs, fname, part_idx, n_parts, fmt, split_naming, overwrite
   2155 )

File c:\Users\arons\anaconda_New3\envs\mne\lib\site-packages\mne\epochs.py:150, in _save_split(epochs, fname, part_idx, n_parts, fmt, split_naming, overwrite)
    147     next_idx = None
    149 with start_and_end_file(fname) as fid:
--> 150     _save_part(fid, epochs, fmt, n_parts, next_fname, next_idx)

File c:\Users\arons\anaconda_New3\envs\mne\lib\site-packages\mne\epochs.py:163, in _save_part(fid, epochs, fmt, n_parts, next_fname, next_idx)
    160     write_id(fid, FIFF.FIFF_PARENT_BLOCK_ID, info["meas_id"])
    162 # Write measurement info
--> 163 write_meas_info(fid, info)
...
--> 121     assert len(data) == 3
    122     data_size = 4
    123     jd = np.sum(_cal_to_julian(*data))

AssertionError: