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)
| 119 | |
| 120 | |
| 121 | def _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 | |
| 140 | def _save_part(fid, epochs, fmt, n_parts, next_fname, next_idx): |
no test coverage detected