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

Function _check_preload

mne/utils/check.py:331–351  ·  view source on GitHub ↗

Ensure data are preloaded.

(inst, msg)

Source from the content-addressed store, hash-verified

329
330
331def _check_preload(inst, msg):
332 """Ensure data are preloaded."""
333 from ..epochs import BaseEpochs
334 from ..evoked import Evoked
335 from ..source_estimate import _BaseSourceEstimate
336 from ..time_frequency import BaseTFR
337 from ..time_frequency.spectrum import BaseSpectrum
338
339 if isinstance(inst, BaseTFR | Evoked | BaseSpectrum | _BaseSourceEstimate):
340 pass
341 else:
342 name = "epochs" if isinstance(inst, BaseEpochs) else "raw"
343 if not inst.preload:
344 raise RuntimeError(
345 "By default, MNE does not load data into main memory to "
346 "conserve resources. " + msg + f" requires {name} data to be "
347 "loaded. Use preload=True (or string) in the constructor or "
348 f"{name}.load_data()."
349 )
350 if name == "epochs":
351 inst._handle_empty("raise", msg)
352
353
354def _check_compensation_grade(info1, info2, name1, name2="data", ch_names=None):

Callers 15

apply_functionMethod · 0.85
cropMethod · 0.85
apply_functionMethod · 0.85
savgol_filterMethod · 0.85
filterMethod · 0.85
resampleMethod · 0.85
apply_hilbertMethod · 0.85
apply_functionMethod · 0.85
__hash__Method · 0.85
shift_timeMethod · 0.85

Calls 1

_handle_emptyMethod · 0.80

Tested by

no test coverage detected