MCPcopy
hub / github.com/mne-tools/mne-python / _save_split

Function _save_split

mne/epochs.py:121–137  ·  view source on GitHub ↗

Split epochs. Anything new added to this function also needs to be added to BaseEpochs.save to account for new file sizes.

(epochs, split_fnames, part_idx, n_parts, fmt, overwrite)

Source from the content-addressed store, hash-verified

119
120
121def _save_split(epochs, split_fnames, part_idx, n_parts, fmt, overwrite):
122 """Split epochs.
123
124 Anything new added to this function also needs to be added to
125 BaseEpochs.save to account for new file sizes.
126 """
127 # insert index in filename
128 this_fname = split_fnames[part_idx]
129 _check_fname(this_fname, overwrite=overwrite)
130
131 next_fname, next_idx = None, None
132 if part_idx < n_parts - 1:
133 next_idx = part_idx + 1
134 next_fname = split_fnames[next_idx]
135
136 with start_and_end_file(this_fname) as fid:
137 _save_part(fid, epochs, fmt, n_parts, next_fname, next_idx)
138
139
140def _save_part(fid, epochs, fmt, n_parts, next_fname, next_idx):

Callers 1

saveMethod · 0.85

Calls 3

_check_fnameFunction · 0.85
start_and_end_fileFunction · 0.85
_save_partFunction · 0.85

Tested by

no test coverage detected