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

Function test_get_inst_data

mne/utils/tests/test_numerics.py:55–75  ·  view source on GitHub ↗

Test _get_inst_data.

()

Source from the content-addressed store, hash-verified

53
54
55def test_get_inst_data():
56 """Test _get_inst_data."""
57 raw = read_raw_fif(fname_raw)
58 raw.crop(tmax=1.0)
59 assert_array_equal(_get_inst_data(raw), raw._data)
60 raw.pick(raw.ch_names[:2])
61
62 epochs = make_fixed_length_epochs(raw, 0.5)
63 assert_array_equal(_get_inst_data(epochs), epochs._data)
64
65 evoked = epochs.average()
66 assert_array_equal(_get_inst_data(evoked), evoked.data)
67
68 evoked.crop(tmax=0.1)
69 picks = list(range(2))
70 freqs = [50.0, 55.0]
71 n_cycles = 3
72 tfr = tfr_morlet(evoked, freqs, n_cycles, return_itc=False, picks=picks)
73 assert_array_equal(_get_inst_data(tfr), tfr.data)
74
75 pytest.raises(TypeError, _get_inst_data, "foo")
76
77
78def test_hashfunc(tmp_path):

Callers

nothing calls this directly

Calls 7

read_raw_fifFunction · 0.90
_get_inst_dataFunction · 0.90
make_fixed_length_epochsFunction · 0.90
tfr_morletFunction · 0.90
cropMethod · 0.45
pickMethod · 0.45
averageMethod · 0.45

Tested by

no test coverage detected