Test _get_inst_data.
()
| 53 | |
| 54 | |
| 55 | def 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 | |
| 78 | def test_hashfunc(tmp_path): |
nothing calls this directly
no test coverage detected