@testing.requires_testing_data
def test_simulate_raw_bem():
    seed = 42
    raw, src, stc, trans, sphere = _get_data()
    raw_sim_sph = simulate_raw(raw, stc, trans, src, sphere, cov=None,
                               ecg=True, blink=True, random_state=seed)
    raw_sim_bem = simulate_raw(raw, stc, trans, src, bem_fname, cov=None,
                               ecg=True, blink=True, random_state=seed,
                               n_jobs=2)
    # some components (especially radial) might not match that well,
    # so just make sure that most components have high correlation
    assert_array_equal(raw_sim_sph.ch_names, raw_sim_bem.ch_names)
    picks = pick_types(raw.info, meg=True, eeg=True)
    n_ch = len(picks)
    corr = np.corrcoef(raw_sim_sph[picks][0], raw_sim_bem[picks][0])
    assert_array_equal(corr.shape, (2 * n_ch, 2 * n_ch))
    assert_true(np.median(np.diag(corr[:n_ch, -n_ch:])) > 0.9)
Test simulation of raw data with BEM
dataset/ETHPy150Open mne-tools/mne-python/mne/simulation/tests/test_raw.py/test_simulate_raw_bem