MCPcopy Index your code
hub / github.com/mne-tools/mne-python / save

Method save

mne/decoding/base.py:174–199  ·  view source on GitHub ↗

Save the object to disk (in HDF5 format). Parameters ---------- fname : path-like The file path to save to. Should end with ``'.h5'`` or ``'.hdf5'``. %(overwrite)s %(verbose)s Notes ----- .. versionadded:: 1.12

(self, fname, *, overwrite=False, verbose=None)

Source from the content-addressed store, hash-verified

172
173 @verbose
174 def save(self, fname, *, overwrite=False, verbose=None):
175 """Save the object to disk (in HDF5 format).
176
177 Parameters
178 ----------
179 fname : path-like
180 The file path to save to. Should end with ``'.h5'`` or
181 ``'.hdf5'``.
182 %(overwrite)s
183 %(verbose)s
184
185 Notes
186 -----
187 .. versionadded:: 1.12
188 """
189 _, write_hdf5 = _import_h5io_funcs()
190 class_name = getattr(self, "_save_fname_type", type(self).__name__.lower())
191 check_fname(fname, class_name, (".h5", ".hdf5"))
192 fname = _check_fname(fname, overwrite=overwrite, verbose=verbose)
193 write_hdf5(
194 fname,
195 self.__getstate__(),
196 overwrite=overwrite,
197 title="mnepython",
198 slash="replace",
199 )
200
201 def fit(self, X, y=None):
202 """..."""

Callers 3

test_xdawn_save_loadFunction · 0.45
test_io_roundtripFunction · 0.45
test_ssd_save_loadFunction · 0.45

Calls 5

__getstate__Method · 0.95
_import_h5io_funcsFunction · 0.85
check_fnameFunction · 0.85
_check_fnameFunction · 0.85
write_hdf5Function · 0.85

Tested by 3

test_xdawn_save_loadFunction · 0.36
test_io_roundtripFunction · 0.36
test_ssd_save_loadFunction · 0.36