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

Function start_and_end_file

mne/_fiff/write.py:315–319  ·  view source on GitHub ↗

Start and (if successfully written) close the file.

(fname, id_=None, *, overwrite=True)

Source from the content-addressed store, hash-verified

313
314@contextmanager
315def start_and_end_file(fname, id_=None, *, overwrite=True):
316 """Start and (if successfully written) close the file."""
317 with start_file(fname, id_=id_, overwrite=overwrite) as fid:
318 yield fid
319 end_file(fid) # we only hit this line if the yield does not err
320
321
322def check_fiff_length(fid, close=True):

Callers 15

_save_splitFunction · 0.85
write_transFunction · 0.85
write_bem_surfacesFunction · 0.85
_write_bem_solution_fifFunction · 0.85
_write_morph_mapFunction · 0.85
write_eventsFunction · 0.85
saveMethod · 0.85
write_projFunction · 0.85
saveMethod · 0.85
_write_evokedsFunction · 0.85
write_forward_solutionFunction · 0.85
write_source_spacesFunction · 0.85

Calls 2

start_fileFunction · 0.85
end_fileFunction · 0.85

Tested by

no test coverage detected