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

Function _allocate_data

mne/io/base.py:2631–2638  ·  view source on GitHub ↗

Allocate data in memory or in memmap for preloading.

(preload, shape, dtype)

Source from the content-addressed store, hash-verified

2629
2630
2631def _allocate_data(preload, shape, dtype):
2632 """Allocate data in memory or in memmap for preloading."""
2633 if preload in (None, True): # None comes from _read_segment
2634 data = np.zeros(shape, dtype)
2635 else:
2636 _validate_type(preload, "path-like", "preload")
2637 data = np.memmap(str(preload), mode="w+", dtype=dtype, shape=shape)
2638 return data
2639
2640
2641def _convert_slice(sel):

Callers 2

_read_segmentMethod · 0.85
appendMethod · 0.85

Calls 1

_validate_typeFunction · 0.85

Tested by

no test coverage detected