Test that our shortcut for smooth=0 works.
()
| 264 | |
| 265 | @testing.requires_testing_data |
| 266 | def test_surface_source_morph_shortcut(): |
| 267 | """Test that our shortcut for smooth=0 works.""" |
| 268 | stc = mne.read_source_estimate(fname_smorph) |
| 269 | morph_identity = compute_source_morph( |
| 270 | stc, |
| 271 | "sample", |
| 272 | "sample", |
| 273 | spacing=stc.vertices, |
| 274 | smooth=0, |
| 275 | subjects_dir=subjects_dir, |
| 276 | ) |
| 277 | stc_back = morph_identity.apply(stc) |
| 278 | assert_allclose(stc_back.data, stc.data, rtol=1e-4) |
| 279 | abs_sum = morph_identity.morph_mat - speye(len(stc.data), format="csc") |
| 280 | abs_sum = np.abs(abs_sum.data).sum() |
| 281 | assert abs_sum < 1e-4 |
| 282 | |
| 283 | |
| 284 | def assert_power_preserved(orig, new, limits=(1.0, 1.05)): |
nothing calls this directly
no test coverage detected